Hi
I have created a model in blender 2.60a. It is very simple, it is a rectangle. The model also has a animation (armature with 3 bones).
When I import the model into jme, the model is ok.
But if I run the animation (uncomment [java]channel.setAnim(“ArmatureAction”);[/java] line), the model is wrong and the animation is not executed.
http://i.imgur.com/bUQRl.png
Is animation on blender 2.6 supported? What am I doing wrong?
Thanks in advance,
H
Model:
http://www.2shared.com/file/XnPRwkuL/gusano.html
Texture:
http://i.imgur.com/Gupd4.png
Code:
[java]
package mygame;
import com.jme3.animation.AnimChannel;
import com.jme3.animation.AnimControl;
import com.jme3.app.SimpleApplication;
import com.jme3.asset.BlenderKey;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.texture.Texture;
public class Alphonce extends SimpleApplication {
private AnimChannel channel;
private AnimControl control;
public static void main(String[] args) {
Alphonce app = new Alphonce();
app.start();
}
@Override
public void simpleInitApp() {
Material mat_stl = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
Texture tex_ml = assetManager.loadTexture(“Textures/Gupd4.png”);
mat_stl.setTexture(“ColorMap”, tex_ml);
flyCam.setMoveSpeed(10);
BlenderKey blenderKey = new BlenderKey(“Models/gusano.blend”);
Spatial scene = (Spatial) assetManager.loadModel(blenderKey);
rootNode.attachChild(scene);
Spatial model = this.findNode(rootNode, “gusano”);
model.center();
model.setMaterial(mat_stl);
control = model.getControl(AnimControl.class);
channel = control.createChannel();
//channel.setAnim(“ArmatureAction”);
viewPort.setBackgroundColor(ColorRGBA.Gray);
}
private Spatial findNode(Node rootNode, String name) {
if (name.equals(rootNode.getName())) {
return rootNode;
}
return rootNode.getChild(name);
}
}
[/java]