Hello, I have a problem with accessing parts of the geometry for an .OBJ asset I am loading. In 3DS, I have named the different objects, and when exporting to .OBJ, I get a structure looking like this;
[java]#
object MyObject
[/java]
followed by lots of what I assume to be vertex definitions (v -36.3748 -4.5192 -5.0073 and so on). After that you get a section starting like this:
[java]g MyObject
usemtl MetalSemi
[/java]
followed by I-don’t-even. Then, the next named object starts.
I am trying to extract these specific geometries for individual manipulation in jme, but I don’t understand what getChild() actually references. It seems to reference by material, not by object. For example, if I do this:
[java] model= (Node)assetManager.loadModel(“model.obj”);
Geometry test = (Geometry)model.getChild(“MyObject”);
[/java]
the Geometry will be instanced to null. If I do this:
[java] System.out.println("Num children: " + model.getChildren().size());
[/java]
it returns 12, which is exactly the number of different materials defined in my .MTL file. If I do this:
[java] model= (Node)assetManager.loadModel(“model.obj”);
Geometry test = (Geometry)model.getChild(3);
[/java]
I get every part of the full model geometry that has the third material defined in the .MTL file.
Is there something off with how my geometry is defined in my model? How do I reference individually named objects from a .OBJ? When working with Blender, I’m just to simply going getChild(“MyObject”) and it works fine.
Thanks in advance for any help.