Trouble while loading ms3d

Hello i'm working again on Bombastic (some of you know about it) and i'm facing a new problem while my prereqs have changed.

In JME 0.9 the code under was working, now the Texture of the loaded Model is not found. Do you have any idea how to solve the problem.

If ti consist to edit the model can you provide me a godd editor for milkshape ?


      trace.startMethod("BoardUI.loadBoardModel()");
      Node boardNode=null;
      MilkToJme converter=new MilkToJme();
      converter.setProperty("texdir","resources/models/");
      ByteArrayOutputStream BO=new ByteArrayOutputStream();

      URL diceModel=DiceUI.class.getClassLoader().getResource("./resources/models/board.ms3d");
   
      try
      {
         converter.convert(diceModel.openStream(),BO);
      } catch (IOException e) {
         trace.println("damn exceptions:" + e.getMessage());
      }
      try
      {
         boardNode=(Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
      } catch (IOException e) {
         trace.println("damn exceptions:" + e.getMessage());
      }
      URL textu=DiceUI.class.getClassLoader().getResource("./resources/models/boardFace.bmp");
      TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
      ts.setEnabled(true);

      Texture texture = TextureManager.loadTexture(
      textu,
      Texture.MM_LINEAR,
      Texture.FM_LINEAR);
      texture.setWrap(Texture.WM_WRAP_S_WRAP_T);
      ts.setTexture(texture);
      boardNode.setRenderState(ts);
      TextureManager.releaseTexture(texture);
      boardNode.updateRenderState();

      boardNode.setLocalScale(.18f);
      trace.endMethod();
      return

This looks like classpath issue.



Either your ide project or ant buld.xml isn't configured to have the resource in the classpath.

I don't think so as the model iteself is found and other textures for other stuff in the game are fojnd too…

Ok, it's something else then.



If you're using linux, be sure that the file permissions are correct so you can read the file.  Also make sure that the case is exactly correct for the file and the path .



If you're using windows, be sure that the file exists and actually has the correct name.  Windows has a neat feature that hides details from you (like filename extensions) and sometimes a ".txt" or something will appended to the file.



If none of the above work, try loading a different texture temporarily to see if it's a problem with the file itself or what.


So after a few other tests I was getting this error:
java.io.FileNotFoundException: COLMFTR1.TGA (The system cannot find the file specified)
I found that my textures were never being imported.  I then read a post that you had replied to about tex_url or setting the override location and checked the source code for the texture property for MaxToJme and thus on down the line, fixed my own issue.  I have converted my files with a custom converter and now they import with BinaryImporter correctly.


The above is from the last post in this thread.  I have no idea if you are having the same problem but it sounds like it.

Also that post is a little vague about the fix but it should point you in the right direction, maybe  :P


- Chris

Solved here:

http://www.jmonkeyengine.com/jmeforum/index.php?topic=5492.0



:slight_smile: