Hello guys,
I successfully imported a model from blender to JME3 (with animations). After that I created the attachment node of the head via the SDK (3.1 beta). When I click just after that on this attachment node while an nimation is played I see the node is refreshing translation, rotation etc. But after I saved my model and let’s say open it again the values are not refreshed anymore, why ?
I wrote the following Code to illustrate the problem:
@Override
public void simpleInitApp() {
Spatial scene = assetManager.loadModel("Scenes/FlatTerrainScene.j3o");
rootNode.attachChild(scene);
human = (Node) assetManager.loadModel("Models/HumanModels/human-base.mesh.j3o");
human.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"));
rootNode.attachChild(human);
AnimControl humanControl = human.getControl(AnimControl.class);
AnimChannel channel = humanControl.createChannel();
channel.setAnim("humawalk");
// this way does work !!!
SkeletonControl sceleton = human.getControl(SkeletonControl.class);
headNode = sceleton.getAttachmentsNode("Head");
// this does NOT work, don't know why ?!
// headNode = (Node) human.getChild("Head_attachnode");
AmbientLight ambient = new AmbientLight();
ambient.setColor(ColorRGBA.White);
rootNode.addLight(ambient);
}
@Override
public void simpleUpdate(float tpf) {
cam.setLocation(headNode.getLocalTranslation());
}
You also see if it works when the cam is going with the walk animation what it actually does in the code above.
Hope somebody could tell me why this is the way it is or what I am doing wrong here. Of course I just could use the solution above but I am still wondering about this. (Maybe it’s a bug).
Thanks in advance