Order of TriMesh's in a loaded Node

It seems rather random, the order of the TriMeshs within a Node I loaded from an obj file.

I essentially have 2 objects to texture. And these textures can be loaded with a collection of "skins" so it's not the same one each time. The first object is a Disc. The second is a plane where the artwork goes.

I can run the game 5 times with the disc being getChild(0), then the 6th time it's getChild(1). How can I determine which child is the disc and which is the plane when the object is loaded?

any word on how to detect which model within a node is which?

You could try it by getting them by name if they have unique names


                    URL urlTmp = ResourceLoader.class.getClassLoader().getResource(me.getValue().toString());
                    converter.setProperty("mtllib", urlTmp);
                    converter.convert(urlTmp.openStream(), BOtmp);
                    Spatial nodeTmp = (Spatial) BinaryImporter.getInstance().load(new ByteArrayInputStream(BOtmp.toByteArray()));
                    nodeTmp.setModelBound(new BoundingBox());
                    if ((nodeTmp.getType() & Spatial.NODE) != 0) {
                        Node tmp = (Node) nodeTmp;
                        System.out.println("Loaded Obj as Node:" + nodeTmp.toString() + " : " + tmp.getChild(0).getName() + " : " + tmp.getChild(1).toString());

Loaded Obj as Node:obj file (com.jme.scene.Node) : temp0 : temp1 (com.jme.scene.TriMesh)

temp0 can be the flat artwork area, or the 3D disc model. There doesn't seem to be an order as each time i run the app, it may be different.

Sample of the obj file. Any instance of "g" i put a name to see if it would show up. But for some reason, it ignores them and uses "temp" + the index that it was loaded in.

mtllib ./diskfull.mtl
g test
# object Object01 to come ...
v  30.732658 1.224563 17.623459
v  17.739658 1.224579 30.653616
vn  0.911459 0.356818 -0.229628
# 243 vertex normals

g Object01
usemtl 09_-_Default
s 0

I guess when I searched around, at the time I was trying to get the sort order for the individual objects. Since there was none, i should have found out that the name wasn't getting pulled over either.

What I should have looked for was "jme import obj group name"


Furthermore, although Sketchup faithfully recorded the group names into the exported .obj files, JME