Hi everyone, this is my first game so I’m new in this. I’m having a big problem since days, and I’m not sure if It’s a problem in blender or in jmonkey. I made in blender, the skeleton and the animation of this mesh:
Note: I did the animation called “Derecha” that turns his head to the right.
My game runs well, until I trigger the animation with his corresponding key, and throw the following error:
jul 08, 2016 10:55:47 PM java.util.prefs.WindowsPreferences <init>
Advertencia: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
jul 08, 2016 10:55:48 PM com.jme3.system.JmeDesktopSystem initialize
Información: Running on jMonkeyEngine 3.0.10
jul 08, 2016 10:55:48 PM com.jme3.system.Natives extractNativeLibs
Información: Extraction Directory: C:\Users\Slaush\Documents\jmonkey\DONT LOOK
jul 08, 2016 10:55:49 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
Información: Lwjgl 2.9.0 context running on thread LWJGL Renderer Thread
jul 08, 2016 10:55:49 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
Información: Adapter: igdumd64
jul 08, 2016 10:55:49 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
Información: Driver Version: null
jul 08, 2016 10:55:49 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
Información: Vendor: Intel
jul 08, 2016 10:55:49 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
Información: OpenGL Version: 3.1.0 - Build 9.17.10.4229
jul 08, 2016 10:55:49 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
Información: Renderer: Intel(R) HD Graphics 3000
jul 08, 2016 10:55:49 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
Información: GLSL Ver: 1.40 - Intel Build 9.17.10.4229
jul 08, 2016 10:55:49 PM com.jme3.asset.AssetConfig loadText
Advertencia: Cannot find loader com.jme3.scene.plugins.blender.BlenderModelLoader
jul 08, 2016 10:55:49 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
Información: Audio Device: OpenAL Soft
jul 08, 2016 10:55:49 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
Información: Audio Vendor: OpenAL Community
jul 08, 2016 10:55:49 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
Información: Audio Renderer: OpenAL Soft
jul 08, 2016 10:55:49 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
Información: Audio Version: 1.1 ALSOFT 1.15.1
jul 08, 2016 10:55:49 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
Información: AudioRenderer supports 64 channels
jul 08, 2016 10:55:49 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
Información: Audio effect extension version: 1.0
jul 08, 2016 10:55:49 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
Información: Audio max auxilary sends: 4
jul 08, 2016 10:55:51 PM com.jme3.app.Application handleError
Grave: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.ArrayIndexOutOfBoundsException: -4
at com.jme3.animation.CompactQuaternionArray.deserialize(CompactQuaternionArray.java:97)
at com.jme3.animation.CompactQuaternionArray.deserialize(CompactQuaternionArray.java:43)
at com.jme3.animation.CompactArray.get(CompactArray.java:132)
at com.jme3.animation.BoneTrack.setTime(BoneTrack.java:231)
at com.jme3.animation.Animation.setTime(Animation.java:110)
at com.jme3.animation.AnimChannel.update(AnimChannel.java:403)
at com.jme3.animation.AnimControl.controlUpdate(AnimControl.java:332)
at com.jme3.scene.control.AbstractControl.update(AbstractControl.java:112)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:570)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:688)
at com.jme3.scene.Node.updateLogicalState(Node.java:145)
at com.jme3.scene.Node.updateLogicalState(Node.java:152)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:244)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:744)
My code is this:
public class Main extends SimpleApplication {
private AnimControl control;
private AnimChannel channel;
private Node Mario;
private static final String ANI_DERECHA = "Derecha";
private final static Trigger TRIGGER_DERECHA = new KeyTrigger(KeyInput.KEY_F);
private final static String MAPPING_DERECHA = "Girar derecha cabeza";
public static void main(String[] args) {
AppSettings settings = new AppSettings(false);
settings.setTitle("Don't Look");//titulo de la ventana
settings.setSamples(8);//calidad, diferencia op, 2,4,8,16,32
settings.setSettingsDialogImage("Interface/Mario_Party_logo.png");//img del cuadro inicial de op
Main app = new Main();
app.setSettings(settings); // apply settings to app
app.start();
}
@Override
public void simpleInitApp() {
setDisplayFps(false);
setDisplayStatView(false);
inputManager.addMapping(MAPPING_DERECHA, TRIGGER_DERECHA);
inputManager.addListener(actionListener,new String[]{MAPPING_DERECHA});
viewPort.setBackgroundColor(ColorRGBA.Blue);
Mario = (Node) assetManager.loadModel("Models/Mario/Mario.mesh.j3o");
Vector3f v = new Vector3f(0.0f , -160.0f , -200.0f);
Mario.setLocalTranslation(v);
DirectionalLight sun = new DirectionalLight();
sun.setDirection((new Vector3f(0.0f, -100.0f, 0.0f)));
sun.setColor(ColorRGBA.White);
rootNode.addLight(sun);
DirectionalLight sun1 = new DirectionalLight();
sun1.setDirection((new Vector3f(-20.0f, -100.0f, -20.0f)));
sun.setColor(ColorRGBA.White);
rootNode.addLight(sun1);
DirectionalLight sun2 = new DirectionalLight();
sun2.setDirection((new Vector3f(0.0f, -200.0f, -350.0f)));
sun.setColor(ColorRGBA.White);
rootNode.addLight(sun2);
flyCam.setMoveSpeed(60f);
rootNode.attachChild(Mario);
control = Mario.getControl(AnimControl.class); // inicializa anim
channel = control.createChannel();
}
private ActionListener actionListener = new ActionListener() {
public void onAction(String name, boolean isPressed, float tpf)
{
if (name.equals(MAPPING_DERECHA) && !isPressed)
{
channel.setAnim(ANI_DERECHA);
}
}
};
This is all, very short actually, but one of my doubts are: Did I save the animation wrong? Did I miss something? why the “Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]”? please help me, I’m about to die
PD: Sorry my possible bad english, It isn’t my native language