Heightmap File Name from TerrainSceneNode
Heightmap File Name from TerrainSceneNode
I'm writing a scene editor that exports the scene to a .zip file. I need to retrieve the heightmap file name from the terrain scene node, but I can't find a suitable method to do so. Any ideas?
The only way that I know of is a bit of a hack. You can use the serializeAttributes() method to get the attributes of the scene node, then query the attributes object for its Heightmap attribute.
I posted some code a while back to get the name of a mesh used by an oct tree scene node. You can see that code here.
Travis
I posted some code a while back to get the name of a mesh used by an oct tree scene node. You can see that code here.
Travis
Didn't get to try it until my next business trip, but it works:
Code: Select all
ITerrainSceneNode* terrain = (ITerrainSceneNode*) smgr->getSceneNodeFromType(ESNT_TERRAIN);
io::IAttributes* attribs = device->getFileSystem()->createEmptyAttributes();
if (attribs)
{
terrain->serializeAttributes(attribs);
core::stringc name = attribs->getAttributeAsString("Heightmap");
wxLogMessage(" heightmap: %s", name.c_str());
attribs->drop();
}