Problem to load saved jme binary 3D model [bug?]

I have any problem to save/load a generic 3D Model previously imported from Collada file.

Attached to this post there are two immagines: the Collada model and the jme binary 3D model saved and loaded by this code.

Take a look to the code part and screenshots below…



Is that a bug?



<
try
   {
      InputStream modelStream = new FileInputStream(modelUrl);
      ColladaImporter.load(modelStream, "modelStream");
   }
   catch (FileNotFoundException e) { e.printStackTrace(); }
   
   String modelName = modelUrl.getName();
   
   {...}
   
   Node loadedModel = new Node(modelName);
   
   MaterialState ms;
   for (String meshName : ColladaImporter.getGeometryNames())
   {
      loadedModel.attachChild(ColladaImporter.getGeometry(meshName));
      Integer mindex = loadedModel.getQuantity()-1;
      ms = Materials.createMaterialState();
      ms.setDiffuse(ColorRGBA.randomColor());
      loadedModel.getChild(mindex).setRenderState(ms);
   }

   /*
    * The code to save from Collada model
    */
   JFileChooser fileChooser = new JFileChooser(Editor.class.getClassLoader().getResource("").getPath());
    if (fileChooser.showSaveDialog(fileChooser) == JFileChooser.APPROVE_OPTION) {
      try { BinaryExporter.getInstance().save((Savable) loadModel, fileChooser.getSelectedFile());   }
      catch(Exception exception) { Console.writeLine(exception.getMessage()); }
    }
   
   /*
    * The code to load a 3D Object
    */
   JFileChooser fileChooser2 = new JFileChooser(Editor.class.getClassLoader().getResource("").getPath());
       if (fileChooser.showOpenDialog(fileChooser2) == JFileChooser.APPROVE_OPTION) {
      try { loadModel = (Node) BinaryImporter.getInstance().load(fileChooser2.getSelectedFile());   }
      catch(Exception exception) { Console.writeLine(exception.getMessage()); }
       }
>





Hmm… looks like a bug to me.  Does your model have bones by any chance?

no, i have imported only meshes list into the collada model.

Maybe you could post the original model file

You can find it here: http://www.timmynet.it/sedia_a.zip

It's a simple model exported from 3D Studio with COLLADA Schema 1.4.1…

Thanks a lot

Hmm… Just tried this locally and got the following:  (this is using our work’s jme model tool, so disregard the selection box)







Maybe you do not have the latest version of jme?


I can take a
the conversation I use the support of collada blender (which does not actually animation)
Now I work with the md5 and I am obliged even for an object that did not articulation of his bones if given a model and dismantled a bit like your chair

I work with Nightly Builds CVS and I update it every day.

I run the program many times, trying different material settings, and few times it work.

renanse said:

Hmm... Just tried this locally and got the following:  (this is using our work's jme model tool, so disregard the selection box)



Maybe you do not have the latest version of jme?


How did u select that item? How did u make that selection box appear?  :D

I clicked on it and it magically appeared!  8)

renanse said:

I clicked on it and it magically appeared!  8)

:) Can u be more specific? I managed so far to import 3ds objects into the scene(each one is in a Node, attached to the rootNode). Now what I'm trying to do is let the user select an item in the scene and move it around, rotate it or scale it. Been reading all sort of posts and so far I see that u have the best solution :D. Care to share?  ;)

He used a special tool to import the model… Well, that is not really true, the importing process is simply the jME loading tool, but he placed it in one custom application (sort of like MonkeyWorld3D).

duenez said:

He used a special tool to import the model... Well, that is not really true, the importing process is simply the jME loading tool, but he placed it in one custom application (sort of like MonkeyWorld3D).


Any idea how to achieve that select box effect? One way I think is to just draw (add them as a child to the node of the model) those lines(knowing exactly the length, width and height of the model) at some offset.

Perhaps looking at SimpleGame or DebugGameState would give an idea on how to achieve it… It has a mode (hitting 'b') that draws the bounding boxes, you can use that information to draw your custom selection highlight.

Yeah, the selection box simply uses a Line object and draws segments at the 4 corners of a given BoundingBox.

Thanks, I'll see what I can do  :D(hopefully good).