[SOLVED] Terrain not saving

jmontgomery

07-12-2008 04:22:34

Hi,

I really like the ETM and have been able to get the 2.3.1 demo up and running under Ogre Eihort, but when I click "O" button, the terrain is not saved and pressing "P" just clears everything out as it is loading the default. I have tried reconfiguring the path to be sure it is outputting to the "media" directory under the installation, but nothing is ever outputted. A search for the files only yields the unmodified originals that came with the package so nothing is ever being saved.

Any ideas?

Thanks,

Justin

CABAListic

07-12-2008 09:49:03

When you say you "reconfigured the path", what exactly did you do? If you changed the path in the resources.cfg, then this can't work. As it is, the output path for the files is hardcoded in the program code, and the path that's specified there must exist, otherwise output can't work.

Of course, if you changed the path in the program code, then I'm not really sure what's going on. Make sure that the path is actually correct as seen from the working dir from which the sample is executed.

jmontgomery

07-12-2008 23:44:54

I have done both.

In ETSample.cpp:

std::string PATH = "C:/Ogre/etm-2.3.1/media";
...
// In saveTerrain()
image.save(PATH + "ET/ETterrain.png");
// other resources set this same way

In ogre's "resources.cfg" added
[ET]
FileSystem=C:\Ogre\etm-2.3.1\media\ET

I copied the ET_Sample.exe file over to the engine/lib directory of my ogre home and ran it from there for easy testing.

The terrain resources should save to that directory when I press "O" as indicated in the code. The app pauses for a few milliseconds, but nothing is outputted as those files are not updated. Ogre is able to find those resources (as you have included defaults with the installation) because pressing "P" resets the terrain. They are simply not being saved.

CABAListic

08-12-2008 11:28:27

That's because you forgot a slash.

PATH + "ET/ETterrain.png" expands to "C:/Ogre/etm-2.3.1/mediaET/ETterrain.png", and I'll bet that the directory mediaET does not exist. Therefore writing to the indicated file will (silently) fail.

jmontgomery

08-12-2008 15:28:09

D'oh! Thanks for pointing that out :oops: I'm at work now but when I get back home I will fix this and let you know if it is working now.

jmontgomery

09-12-2008 00:59:51

That did it! It works now!