I just downloaded 2 models (from a new artist that I have never used used before), but
now I’m having trouble using both of them with an ArmatureMask in JME with the latest version of the engine (v3.6.1-stable)
As soon as I play an animation using an ArmatureMask, the app crashes with the following exception:
java.lang.ClassCastException: class com.jme3.scene.Node cannot be cast to class com.jme3.anim.Joint (com.jme3.scene.Node and com.jme3.anim.Joint are in unnamed module of loader 'app')
at com.jme3.anim.ArmatureMask.contains(ArmatureMask.java:65)
at com.jme3.anim.tween.action.ClipAction.doInterpolate(ClipAction.java:27)
at com.jme3.anim.tween.action.BlendableAction.interpolate(BlendableAction.java:84)
at com.jme3.anim.AnimLayer.update(AnimLayer.java:270)
at com.jme3.anim.AnimComposer.controlUpdate(AnimComposer.java:402)
at com.jme3.scene.control.AbstractControl.update(AbstractControl.java:118)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:743)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:922)
at com.jme3.scene.Node.updateLogicalState(Node.java:228)
at com.jme3.scene.Node.updateLogicalState(Node.java:239)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:265)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:160)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:225)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:242)
at java.base/java.lang.Thread.run(Thread.java:833)
If I use this code to play any animation using an ArmatureMask (regardless of which Joints the mask contains), the app crashes with the exception above:
ArmatureMask mask = new ArmatureMask(skinningControl.getArmature());
animComposer.makeLayer("RootLayer", mask);
animComposer.setCurrentAction("Walk_F_IP", "RootLayer"); //crashes
However, I do not have any issues when I play the animation in the SDK or in my game without armatureMasks. It runs fine if I directly play an animation on the whole AnimComposer with this code:
animComposer.setCurrentAction(walkAnim); //works
So something strange seems to be happening when the ArmatureMask is getting setup for certain models that is causing a Node to somehow get mixed into a list of Joints.
The models I’m having trouble with are unfortunately paid assets, so I can’t publicly post them for troubleshooting help.
Specifically I’m having trouble with a wolf and pig model from a guy on sketchfab who has some very nice animated animal models, but apparently he does something different in his modeling/animating workflow that JME does not like
So if anyone is willing to help and needs the model to do more investigation, then I can send you a google-drive download link for the model for troubleshooting purposes.
But hopefully the exception I posted can at least help get the troubleshooting process started.