com.jmex.model.XMLparser.Converters.ObjToJme

Hello,



first, there is 1 test to much at the line 198-199:


...
            if (parts.length >= 2 && materialNames.get(parts[1]) != null
                   && materialNames.get(parts[1]) != null)
...



Other point: when i load an OBJ file, it creates TriMesh instances with a dummy name:


private Spatial buildStructure() {
        Node toReturn=new Node("obj file");
        Object[] o=materialSets.keySet().toArray();
        for (int i=0;i<o.length;i++){
            MaterialGrouping thisGroup=(MaterialGrouping) o[i];
            ArraySet thisSet=(ArraySet) materialSets.get(thisGroup);
            if (thisSet.indexes.size()<3) continue;
            TriMesh thisMesh=new TriMesh("temp"+i);
...
           }




I am loading OBJ files and I would like to find out the "definitions" of the TriMesh objects. One way is to parse them according to their names.

My request: should it be possible to modify the code in order to set their names with their "material names" (written in materialNames), something like:


    private Spatial buildStructure() {
        Node toReturn=new Node("obj file");
       
        Set keys = materialNames.keySet() ;
       
        Iterator it = keys.iterator() ;
       
        while (it.hasNext())
        {
           String name = (String) it.next() ;
          
           MaterialGrouping thisGroup = (MaterialGrouping) materialNames.get(name) ;
           ArraySet thisSet=(ArraySet) materialSets.get(thisGroup);
          
           if (thisSet.indexes.size()<3) continue;
          
           TriMesh thisMesh=new TriMesh(name);
          
         ... 
        }



cj