GetChild Function
Blitz3D Forums/Blitz3D Beginners Area/GetChild Function
| ||
Hi, I figured how to use the GetChild with great results but I noticed something and I need some help. Ok, I use MAX6 and I export my gun, and hand to a .b3d format with no problem. I can GetChild the hand just find (containing of 1 mesh-no group)... but... I cannot GetChild my Barrel (containing 12 objects in a group). So is there a trick to load a grouped set of meshes thats been grouped within a .b3d file? thanx for any help :) |
| ||
You should be able to give the mesh a name in your modelling program and then use FindChild to get it's entity handle. FindChild works recursively, so it doesn't matter how deep in the mesh hierarchy your target mesh is. Possibly you're already doing this, but make sure you use LoadAnimMesh to load multi-mesh entities or they will get combined into a single mesh when loaded. eg. Graphics3D 800, 600, 0, 2 ;SetBuffer BackBuffer() cube1 = CreateCube() cube2 = CreateCube() cube3 = CreateCube() NameEntity cube3, "cube3" EntityParent cube2, cube1 EntityParent cube3, cube2 Print cube3 Print FindChild( cube1, "cube3" ) WaitKey End |
| ||
Alternatively perhaps try using loadanimmesh(entity) as I think this keeps the meshes in the model separate. IPete2. |
| ||
Your right Pete :o) If you load your mesh with LoadMesh, i won't keep the child components i'm sure. |