mD5 fadingOut issue

I'm having issues with the MD5importer. I had everything working when I had them on separate JointControllers but then I realized that such was redundant and that their was a better way to do it so i decided to create a single JontController to Control the modelNode however I'm having issues with .setFading Command I get this error


Oct 26, 2008 10:35:47 AM com.jmex.game.DefaultUncaughtExceptionHandler uncaughtException
SEVERE: Main game loop broken by uncaught exception
java.lang.NoSuchMethodError: com.model.md5.controller.JointController.setFading(Ljava/lang/String;FZ)V
   at com.tps1.RandomCharacter.CubeController.update(CubeController.java:105)
   at com.jme.scene.Spatial.updateWorldData(Spatial.java:540)
   at com.jme.scene.Node.updateWorldData(Node.java:383)
   at com.jme.scene.Spatial.updateGeometricState(Spatial.java:516)
   at com.jmex.game.state.BasicGameState.update(BasicGameState.java:71)
   at com.jmex.game.state.GameStateNode.update(GameStateNode.java:71)
   at com.jmex.game.StandardGame.update(StandardGame.java:353)
   at com.jmex.game.StandardGame.run(StandardGame.java:225)
   at java.lang.Thread.run(Thread.java:619)



It only happens when I press S and realized it was because walk is default so when I pressed A to walk nothing would happen.

this is the code

package com.tps1.RandomCharacter;
 
import java.io.IOException;
import java.net.URL;

import com.jme.input.KeyInput;
import com.jme.input.controls.GameControl;
import com.jme.input.controls.GameControlManager;
import com.jme.input.controls.binding.KeyboardBinding;
import com.jme.input.controls.binding.MouseButtonBinding;
import com.jme.math.Quaternion;
import com.jme.scene.Controller;
import com.jme.scene.Node;
import com.model.md5.JointAnimation;
import com.model.md5.ModelNode;
import com.model.md5.controller.JointController;
import com.model.md5.importer.MD5Importer;
import com.tps1.aMain.Main;
import com.tps1.util.UnifiedModelLoader;

import static com.tps1.RandomCharacter.CubeController.CubeAction.*;
import static com.jme.input.KeyInput.*;
import static com.jme.input.controls.binding.MouseButtonBinding.*;
 
/**
Now we need some explanations. First, I'm using a bunch of enums for the different actions. This is not required for the GameControl system, it works with Strings. But enums have some nice properties compared to Strings: They are real classes, you can use them in switch statements and you can never spell them wrong, because the compiler will warn you. Using Strings as

it seems that you have some problems with ur custom UnifiedModelLoader. it doesnt seem likely the error u r getting has anything to do with the importer itself.



i would sugguest take a look at ur controller UML, there might be some inheritance error there.

I had checked the UnifiedLoader Several times before I even considered it to be a problem in the controller heres the class can you spot the error


package com.tps1.util;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;

import com.jme.math.Quaternion;
import com.jme.math.Vector3f;
import com.jme.scene.Node;
import com.jme.util.export.Savable;
import com.jme.util.export.binary.BinaryExporter;
import com.jme.util.export.binary.BinaryImporter;
import com.jme.util.resource.MultiFormatResourceLocator;
import com.jme.util.resource.ResourceLocatorTool;
import com.jmex.model.converters.AseToJme;
import com.jmex.model.converters.FormatConverter;
import com.jmex.model.converters.MaxToJme;
import com.jmex.model.converters.Md2ToJme;
import com.jmex.model.converters.Md3ToJme;
import com.jmex.model.converters.MilkToJme;
import com.jmex.model.converters.ObjToJme;
import com.jmex.model.util.ModelLoader;
import com.model.md5.JointAnimation;
import com.model.md5.ModelNode;
import com.model.md5.controller.JointController;
import com.model.md5.importer.MD5Importer;
import com.tps1.aMain.Main;

public class UnifiedModelLoader{
    /*
    *  This method opens a model in various format evaluating the extension
    *  In case in the same directory is already presents the same model in jbin format loads it
    *  Otherways load the model and save a jbin copy for the next time.
    * 
    *  Attention : in case the original model is changed you'll have to delete the jbin one the reload it.
    */      
   
   //Create a path to locate Textures
   static String texturepath ;
   /**
    * @author Kyle Williams
    * @description Loads a model file from a URL and saves it as a jbin for quicker loading
    * @param modelFile is the file path
    * @return loadedFile is the model created
    */
   public static Node loadModel (String modelFile){
      ModelNode         loadedModel   = null;
      FormatConverter      formatConverter = null;      
      ByteArrayOutputStream    BO       = new ByteArrayOutputStream();
      String         modelFormat    = modelFile.substring(modelFile.lastIndexOf(".") + 1, modelFile.length());
      String         modelBinary   = modelFile.substring(0, modelFile.lastIndexOf(".") + 1) + "jbin";
      URL         modelURL   = Main.class.getClassLoader().getResource(modelBinary);
      //Finds texture path using stored binary location
      texturepath = modelFile;      
      
      //verify the presence of the jbin model
      if ((modelURL == null)&&(!modelFormat.equals("md5mesh"))){
      
         modelURL      = Main.class.getClassLoader().getResource(modelFile);
         
         //evaluate the format
         if (modelFormat.equals("3ds")){
            formatConverter = new MaxToJme();
         } else if (modelFormat.equals("md2")){
            formatConverter = new Md2ToJme();
         } else if (modelFormat.equals("md3")){
            formatConverter = new Md3ToJme();
         } else if (modelFormat.equals("ms3d")){
            formatConverter = new MilkToJme();
         } else if (modelFormat.equals("ase")){
            formatConverter = new AseToJme();
         } else if (modelFormat.equals("obj")){
            formatConverter = new ObjToJme();
         }
         formatConverter.setProperty("mtllib", modelURL);
         
         try {
            formatConverter.convert(modelURL.openStream(), BO);
            loadedModel = (ModelNode) BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
            
            //save the jbin format
            BinaryExporter.getInstance().save((Savable)loadedModel, new File("src/"+modelBinary));
         } catch (IOException e) {            
            e.printStackTrace();
            return null;
         }
         System.out.println("Saved model successfully n Loading Model");   
      
      }else if ((modelURL == null)&&(modelFormat.equals("md5mesh"))){   //Loads md5 model
         
         modelURL      = Main.class.getClassLoader().getResource(modelFile);
      UnifiedModelLoader.overrideTextureKey();
         try {
            MD5Importer.getInstance().loadMesh(modelURL, "ModelNode");
         } catch (IOException e) {
            e.printStackTrace();
         }
         ModelNode body = MD5Importer.getInstance().getModelNode();
         //clean up importer
         MD5Importer.getInstance().cleanup();         
         body.flagUpdate();
      /**
         
         try {      
            loadedModel = body;
            //save the jbin format
            BinaryExporter.getInstance().save((Savable)loadedModel, new File("src/"+modelBinary));
      } catch (IOException e) {e.printStackTrace();
         return null;}
         System.out.println("Saved md5 model successfully n Loading Model");   
         */
         //temporary load until ready to create the jbin
         return body;
         
         
       }else{
          
         try {
            //load the jbin format
            loadedModel = (ModelNode) BinaryImporter.getInstance().load(modelURL.openStream());
         } catch (IOException e) {
            return null;
         }
         System.out.println("Loaded model successfully");
      }
      
      return loadedModel;
   }
//load md5 texture
   public static void overrideTextureKey() {
      try {
         MultiFormatResourceLocator locator = new MultiFormatResourceLocator(Main.class.getClassLoader().getResource(texturepath),
               new String[]{".tga", ".bmp", ".png", ".jpg", ".texture", ".jme"});
         ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE, locator);
      } catch (URISyntaxException e) {
         e.printStackTrace();
      }
            
   }
   
   /**
    * @author Kyle Williams
    * @description Creates a to Controller to load animations
    * @param AnimationName is the name the user wants to give the animation
    * @param animationpath is the URL of the aniamtion
    * @param modelNode2 is the original model
    * @return animate is the new animation created
    */
   public static JointController doMd5Animation(Node modelNode2){      
   //Loads the animation from a file and assign it a name   
      
      JointController animate= new JointController(((ModelNode) modelNode2).getJoints());
      //by setting it to 1 means setting it to RT_WRAP
      animate.setRepeatType(1);
      ((ModelNode) modelNode2).addController(animate);
      MD5Importer.getInstance().cleanup();
      
      return animate;   
   }
   
   public static JointAnimation doMd5Animate(String animationName, URL animationpath){      
      //Loads the animation from a file and assign it a name   
         try {
            MD5Importer.getInstance().loadAnim(animationpath, animationName);
         } catch (IOException e) {
            System.out.println("Error....Loading Animation");
            e.printStackTrace();
         }
         JointAnimation animation = MD5Importer.getInstance().getAnimation();         
         MD5Importer.getInstance().cleanup();
         
         return animation;   
      }


}

well thx to duenez I was able to figure out the issue. The problem wasn't with the code it was with the class that it compiled apparently it was out of sync

                                                              Thank You duenez!!!

Wow! It is flattering you took the time to thank me publicly… I am always glad to help!  :smiley: