In all modelling programs (I'm currently using 3dsMAX), you can give names to the objects you are creating. My question is, is there a way to recover the name and position (and mesh data, and ...) of those objects once they have been exported to some 3D format (such as .b3d or .X or .3ds) and loaded into Irrlicht?
Irrlicht seems to represent each sub-object of a Mesh with a separate MeshBuffer. I've looked through the API, and apparently meshbuffers don't have names, or at least there is no way to search or recover those names. Am I mistaken?
If not at the meshbuffer level, maybe there's a way to look at the data as it is loaded from the 3D file, and associate a name with each meshbuffer at that moment. Does anyone have insight into the .b3d (or maybe the .X) mesh loader? If there are some callback functions that can be used to get at the data I'm seeking, or if you could show me the right direction for adding one, I'd be very grateful.
I realize I'm assuming that 3D models keep the names from 3dsMAX, that may not even be the case for all of them. Do we know which of the Irrlicht-supported formats do remember the object names?
I need this object detection for several things, but especially for adding tiny markers in 3dsMAX that indicate where some dynamically created objects should appear, and stuff like that. I guess I could use some kind of level editor for that, but markers have served me well in the past, and I'd like to reuse the technique with Irrlicht, instead of introducing yet another tool (and its bugs) into my workflow.
How do you recover an object by name from a 3D model
Nope... I think some of the model loaders in Irrlicht do preserve the groupings by putting them into seperate mesh buffers but they're not named so you won't know which is which...
In general a mesh buffer is just a collection of arbitrary vertices which share the same material... That's pretty much all you can rely on I think, so not much use for what you're trying to do.
In general a mesh buffer is just a collection of arbitrary vertices which share the same material... That's pretty much all you can rely on I think, so not much use for what you're trying to do.
Thanks Hybrid. I'll probable use irrEdit to assemble the scene after making the individual models in 3dsMAX.hybrid wrote:the scene loaders do support this. Each node has a name, you can recover nodes by name, and you can also edit the scene more easily this way. Try .irr or Collada.
However I must point out that in a past project recovering object names from the MAX scene was very handy: to avoid having to do convex decomposition with complex 3d models, I placed simple collision objects (cylinders, planes, spheres) to form a shell around the object. It's easier to do with MAX's precise controls and clone options than with more basic editors... Then when loading the mesh, I used the collision objects (their name started with "collision") only as physics data, while I displayed the rest in the 3D engine.
I'm surprised that it's actually impossible to do with popular 3D formats: I thought it was a pretty clever idea, that worked well and was flexible.