-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SkeletonDebugger deserializing #2228
Conversation
Here is the code I used to test this. The model is here https://sketchfab.com/3d-models/silver-dragonkin-mir4-89ead4e87cdc4b70840f748383f0998f, get it as FBX:
|
Hi @tonihele , java.lang.NullPointerException
at com.jme3.scene.debug.SkeletonDebugger.updateLogicalState(SkeletonDebugger.java:99)
at com.jme3.scene.Node.updateLogicalState(Node.java:239)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:268)
at com.jme3.system.lwjgl.LwjglWindow.runLoop(LwjglWindow.java:631)
at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:721)
at java.base/java.lang.Thread.run(Thread.java:834) Effectively jme's stock ...
if (fbxNode.skeleton != null) {
jmeSpatial.addControl(new AnimControl(fbxNode.skeleton));
jmeSpatial.addControl(new SkeletonControl(fbxNode.skeleton));
// comment out this code
/*SkeletonDebugger sd = new SkeletonDebugger("debug", fbxNode.skeleton);
Material mat = new Material(fbxNode.assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.getAdditionalRenderState().setWireframe(true);
mat.getAdditionalRenderState().setDepthTest(false);
mat.setColor("Color", ColorRGBA.Green);
sd.setMaterial(mat);
((Node)jmeSpatial).attachChild(sd);*/
} I don't know if the |
SkeletonDebugger is serializable. So IMO it should work, regardless what FBXLoader or anyone else thinks of it. We have no way of deducting how it will be used but it should work flawlessly as it promises to. FBXLoader is another issue. Yes, it feels that it should not be in the master branch yet since it seems to use some debug data. It should not probably use this SkeletonDebugger. There is also another issue about the FBXLoader using the old animation system. |
I agree with you. |
Fix SkeletonDebugger deserializing
Resolves #2226
Prevents NPE after deserializing SkeletonDebugger. The solution is not that pretty. But it works. The children are written/read properly, this just then finds them by the fixed names set.