i've loaded a single scenenode that when i created it had many children is there away to pull a list of children from that scenenode. These are NOT children that have that have been attached in the engine but in a model editor. I have tryed this:
core::list<ISceneNode*>::ConstIterator begin = z.Terrain->getChildren().begin();
core::list<ISceneNode*>::ConstIterator end = z.Terrain->getChildren().end();
for (/**/; begin != end; ++begin)
{
printf("Child Name :%d\n",(*begin)->getName());
}
and it dont work.
Thanks 4 any help
You can have all the power in the world but if you have no one to follow you what good is the power?
What model editor? If it's irrEdit (not a model editor though so probably not) then fair enough but if it's any other model editor then you probably won't have easy access to the children as they're probably not loaded as 'children'. But if they're seperate groups in the model format then you can probably get to the seperate groups in the mesh buffers.
I use lightwave to model and Gile[s] to convert the format to my3d or b3d models. i was just looking at the meshbuffers but i dont no how to use them (if thats even the right way of doing it). Its to bad you couldnt just use getMesh(id of child)
You can have all the power in the world but if you have no one to follow you what good is the power?
Yes, meshbuffers seems to be a better way to access the things you mentioned. The scene node children are only created by scene loaders (.irr, .dae, .bsp), while my3d and b3d just create one scene node.
The meshbuffer structure is not standardized, though, such that you won't know which meshbuffer belongs to which part of the mesh. It won't change on each load, though, such that you can test it by trail and error. Or you can identify the parts by some special material, which would make this task a lot simpler
Ok thanks i might just see about getting my mesh converted to bsp or one of the others. But i think i will try the meshbuffer first but how would i go about getting a a scenenode from the meshbuffer? or will i just have to create a custom node for that?
You can have all the power in the world but if you have no one to follow you what good is the power?
bsp wouldn't help, because geometry will be kept in one scene node.
You cannot get a scene node from a meshbuffer (well, you could, but I doubt that you want that). You will do node->getMesh(0) to get the IMesh of the geometry. That one is composed of IMeshBuffer objects which you can access via the API methods.
Question is what you want to do with the mesh buffers.
i just wanted to see if i could get the child from a scenenode without having to split the mesh up into aload of scenenodes but i guess i cant.
nevermind then thanks for your help anyway.
You can have all the power in the world but if you have no one to follow you what good is the power?
I have a question, when you load your scene as it is, if you move/rotate the parent node, do the children move with it? When you move/rotate a child node does it leave the parent alone? Is the parent/child hierarchy working? If so, then you shouldn't have an issue with getChildren().
I assume that whatever hierarchy you created in lightwave got totally lost during conversion. In this case, either every object is lumped together in one node or every object is it's own node and there is no way to get that information back.
As far as I know, the only ways to fix the issue are to
A: Export your models from lightwave and reassemble them in irrEdit
B: Write your own .irr export plugin for lightwave
C: Abuse some other property such as the node's name or material and use that information to reassemble the hierarchy at runtime