I create some nodes with "smgr->addAnimatedMeshSceneNode(AMesh)" but saveScene() does not save them at all.
CIrrMeshWriter::writeMesh() is never being called. What I'm not understanding?
smgr->saveScene()
-
- Posts: 91
- Joined: Mon Mar 05, 2012 4:51 pm
- Location: Bristol, UK
- Contact:
Re: smgr->saveScene()
saveScene saves a XML of the scene nodes, but not their textures or models, or any file you have loaded eg: heightmaps
Am i understanding your question correctly?
Am i understanding your question correctly?
Re: smgr->saveScene()
SceneWriter only writes scene-information which is indeed a problem for custom creates meshes. I think the following workaround could work - but never tried it myself:
1. Add your custom meshes to the meshcache with a name (IMeshCache::addMesh)
2. Create meshwriter (ISceneManager::createMeshWriter)
3. Write all your custom-meshes to file with the same name you used when you added them to the meshcache.
4. Save your scene.
Alternatively Collada is slowly getting there to be able to save mesh- and sceneinformation. So you could give it a try (use newest trunk - it's a lot better in that respect than Irrlicht 1.7). But it's also not yet perfect (actually I'm stuck on a Collada-problem for a while already - how to save scenenodes which share a mesh but have different materials - something I thought I fixed, but no other tool I found could load it - so either they are all broken (definitely a possibility when you're talking about Collada) or I'm still doing something wrong).
1. Add your custom meshes to the meshcache with a name (IMeshCache::addMesh)
2. Create meshwriter (ISceneManager::createMeshWriter)
3. Write all your custom-meshes to file with the same name you used when you added them to the meshcache.
4. Save your scene.
Alternatively Collada is slowly getting there to be able to save mesh- and sceneinformation. So you could give it a try (use newest trunk - it's a lot better in that respect than Irrlicht 1.7). But it's also not yet perfect (actually I'm stuck on a Collada-problem for a while already - how to save scenenodes which share a mesh but have different materials - something I thought I fixed, but no other tool I found could load it - so either they are all broken (definitely a possibility when you're talking about Collada) or I'm still doing something wrong).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: smgr->saveScene()
Thanks for the answer.
Ok. This works!
But what is now the best for reloading? I see that in the scene .IRR file there are already properties for each animatedscenenode which seem to be duplicated in each exported mesh file.
On the other hand just loading the scene IRR file does not load the mesh data. Should these be loaded before - although the scene IRR file holds the references? Shall I rather create my own scene file?
Weber
Ok. This works!
But what is now the best for reloading? I see that in the scene .IRR file there are already properties for each animatedscenenode which seem to be duplicated in each exported mesh file.
On the other hand just loading the scene IRR file does not load the mesh data. Should these be loaded before - although the scene IRR file holds the references? Shall I rather create my own scene file?
Weber