i can`t find this solution except used in Blender 2.49…
In Blender 2.6 version, How can i set animation name("blarblar") used by AnimChannel.setAnim("blarbl
Are you using loading .blend files or .mesh.xml? Are you able yo see the animcontrol node in SceneExplorer of the SDK? Does it have any animation? Btw there are some guys having issues with the blender loader http://hub.jmonkeyengine.org/groups/import-assets/forum/topic/blender-animation-no-working%c2%ba/?topic_page=2&num=15#post-155639. Maybe this post helps you http://hub.jmonkeyengine.org/groups/import-assets/forum/topic/blender-animation-no-working%c2%ba/?topic_page=2&num=15#post-154965.
Thank you for your advise~^^
- i`m using .mesh.xml.
- No, i can`t see the animcontrol node in SceneExplorer of the SDK.
- Yes, i`ll add one more animation.
So, where can i set animation name?
And… in your link, i found that we should use .blend file right?
And….. in your link, i found that we should use .blend file right?
Not necessarily. The BlenderLoader is still a WIP. Then if you have troubles with that, use OgreXml. I animate my models without problems with the blender 2.6 as well, maybe you are missing doing something important. I can have a check into your model for you if you want.
Oh. Thank you ^^
Here is my blender file link → http://www.2shared.com/file/Ty_ckdzY/StickMan2_3.html
My model is so simple. Since i dont need complicated model which have many vertex.<br /> i
ll use this model in my Android project.
Thank for your help.
I read many guide line and forum. But it muddle me… i think i`m a little stupid.
Well. Your model doesn’t have any animation, but have a crouching pose :P, and I could open it with the SceneComposer and could see that it does have an animcontrol, and I was able to set its animation (in this case is a pose) to the crouching pose that you did in blender. It worked like a charm for me. Make sure you have ever updated your SDK. I updated my SDK about one week ago. What’s your dotscene exporter version? You have to use the one provided by SDK via Tools—>ogrexml. About opening the .blend file directly, I was able to do it too, but I had to add an animation for the model so it works, because the blender loader has a known issue, that you have to add at least one animation for the model, otherwise it will throw a NPE:
[java]
java.lang.NullPointerException
at com.jme3.animation.SkeletonControl.cloneForSpatial(SkeletonControl.java:201)
at com.jme3.scene.Spatial.clone(Spatial.java:1155)
at com.jme3.scene.Node.clone(Node.java:565)
at com.jme3.scene.Node.clone(Node.java:61)
at com.jme3.scene.Spatial.clone(Spatial.java:1142)
at com.jme3.scene.Node.clone(Node.java:565)
at com.jme3.scene.Node.clone(Node.java:61)
at com.jme3.scene.Spatial.clone(Spatial.java:1142)
at com.jme3.scene.Node.clone(Node.java:565)
at com.jme3.scene.Node.clone(Node.java:61)
at com.jme3.scene.Spatial.clone(Spatial.java:1182)
at com.jme3.asset.ModelKey.createClonedInstance(ModelKey.java:58)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:300)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:408)
[catch] at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:90)
at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:53)
at com.jme3.gde.core.assets.AssetData.loadAsset(AssetData.java:75)
at com.jme3.gde.modelimporter.ModelImporterVisualPanel1.loadModel(ModelImporterVisualPanel1.java:95)
at com.jme3.gde.modelimporter.ModelImporterVisualPanel1.loadModel(ModelImporterVisualPanel1.java:74)
at com.jme3.gde.modelimporter.ModelImporterVisualPanel1$8.run(ModelImporterVisualPanel1.java:305)
at java.lang.Thread.run(Thread.java:662)
[/java]
Oh my god… i upload strange blender file… i`m so sorry… Please, would you check one more time?;;;;;
http://www.2shared.com/file/x-sv_RT_/StickMan2_1.html
i installed ogreXml Exporter about one Week ago by SDK → Tools → ogrexml.
Hmmm. Now I know what did you want to say when you said “didn’t work”! Sometimes give details might be helpful and avoid waste of time ;). Is your model being badly animated ok? It’s a known issue, but it’s an issue from ogre exporter side. Take a look at this http://hub.jmonkeyengine.org/groups/general-2/forum/topic/animations-arent-working-at-all/?topic_page=2&num=15#post-148647.
@glaucomardano
Thank for your attention ^^!!! Really!
No… my animation is not working at all except in Blender…
i export my blender to ogre.mesh.xml.
Here is my soruce code
[java]
private AnimChannel channel;
private AnimControl control;
Spatial player;
public void simpleInitApp() {
player = (Spatial) assetManager.loadModel(“b/Cube.mesh.xml”);
player.center();
rootNode.attachChild(player);
…
control = player.getControl(AnimControl.class);
control.addListener(this);
channel = control.createChannel();
for (String anim : control.getAnimationNames()) {
Log.i(“ANIM”,"animation name :: " + anim);
// Output String :: animation name :: my_animation
}
channel.setAnim(“my_animation”);
inputManager.addMapping(“touch”, new TouchTrigger(0));
inputManager.addListener(this, new String[] {“touch”});
}
[/java]
This is my source code…
Also i wonder that I always get result string from ‘control.getAnimationNames()’ is “my_animation”…
i can`t know how can i set this name in Blender…
Before you try to play with animations in source code I strongly recommend you to check it in SceneComposer before. Do you know how to play the animation in SceneComposer? It’s very simple, just open your model in SceneComposer, and look for an animcontrol in SceneExplorer, and try to play its animations. Also, how are you exporting the ogre xmls? I’ve succefully exported the xml files, but I’ve disabled the “export scene” option while exporting the model with the ogre exporter in blender, then it will export just the selected model and its skeleton xml file. About the animation names in blender, it’s simple too (but hidden :P). In blender go to Animation Screen, and in DopeSheet press control and left click the “ArmatureAction” node, that’s it, now you can set the animation name :).
Thank you! i can play the animation in SceneComposer^^
And this animation play regardless of “export scene” option. I Check this.
But…
@glaucomardano said:
About the animation names in blender, it’s simple too (but hidden :P). In blender go to Animation Screen, and in DopeSheet press control and left click the “ArmatureAction” node, that’s it, now you can set the animation name :).
this animation name is not changed....
In blender

In JME SDK,

Is This process right??
@jjwsd said:
Thank you! i can play the animation in SceneComposer^^
And this animation play regardless of “export scene” option. I Check this.
But...
this animation name is not changed....
In blender
http://i.imgur.com/tXjC7.gif
In JME SDK,
http://i.imgur.com/jrbrk.gif
Is This process right??
Hmmm. Maybe it's a bug !? Maybe @Momoko_Fan or @mifth have a fix for that.
Btw check the xml files, check if they have the animation name set properly. Check if the animation is named “startanim” as well. Open the xml files with the a text editor like “notepad” and search for “startanim” by pressing ctrl+f.
@qlaucomardano
Thank you ^^
And… in JME, my animation work well but…!!!
in my Android App, it doesnt work.. i
m tired about this problem
Convert the model to j3o before loading it in-game.
oh i can`t find “startanim”… but i can find “my_animation”.
@jjwsd said:
oh i can`t find "startanim".. but i can find "my_animation".
rename it :P. Then it's not a bug, it's coming as "my_animation" from ogre exporter.
EDIT: Maybe a bug from ogre exporter side ;).
@normen said:
Convert the model to j3o before loading it in-game.
i convert the model to j3o.... But it doesn`t work.
here is my source code. Please help me to find solution.
[java]
public class Stickman extends SimpleApplication implements AnimEventListener, TouchListener {
private AnimChannel channel;
private AnimControl control;
Node player;
@Override
public void simpleInitApp() {
// TODO Auto-generated method stub
viewPort.setBackgroundColor(ColorRGBA.LightGray);
player = (Node) assetManager.loadModel("stickman/Cube.j3o");
player.setLocalScale(0.5f);
rootNode.attachChild(player);
// setting Light.
control = player.getControl(AnimControl.class);
control.addListener(this);
channel = control.createChannel();
channel.setAnim("my_animation");
inputManager.addMapping("touch", new TouchTrigger(0));
inputManager.addListener(this, new String[] {"touch"});
}
public void onTouch(String name, TouchEvent event, float tpf) {
switch (event.getType()) {
case UP:
channel.setAnim("my_animation",2f);
channel.setLoopMode(LoopMode.DontLoop);
break;
}
}
public void onAnimChange(AnimControl arg0, AnimChannel arg1, String arg2) {
}
public void onAnimCycleDone(AnimControl control, AnimChannel channel, String name) {
if(name.equals("my_animation"))
Log.i("ANIM", "ANIM Done!!!!!!!!!!1"); // Animation doesn`t work. but This is always called.
}
}
[/java]
this can be a problem??
http://i.imgur.com/iDIo0.gif
When i exported my blender file to ogre.xml , this screen show in Blender.
Hello, I was having the same problem over and over… and new problems… because of blender version… the animation name, and finally the animation isn’t playing in the SceneComposer…
Oto (the one of the tutorial) works very well… and I decided to get into the xml files… I noticed that Oto has everything (or a lot) inside the submesh tag, while my export was just containing the vertex data I don’t know if this is meaningful … or the order of the tags and the geometry tag, in my export it was… bufferedgeometry and usesharedvertices=“false” < that was true in my export… I changed pretty much the strucuture to fit the Oto’s and it worked
This is the “fixed” file
[xml]
<mesh>
<submeshes>
<submesh usesharedvertices=“false” material=“missing_material”>
<faces count=“36”>
<face v1=“0” v2=“1” v3=“2”/>
… faces …
</faces>
<geometry vertexcount=“72”>
<vertexbuffer texture_coords=“0” positions=“true” colours_diffuse=“False” normals=“true”>
<vertex>
<position y="-0.359639" x=“1.000000” z="-1.000000"/>
<normal y="-0.932517" x="-0.255354" z=“0.255354”/>
</vertex>
… lots of vertex …
</vertexbuffer>
</geometry>
<boneassignments>
<vertexboneassignment vertexindex=“0” weight=“1.0” boneindex=“0”/>
<vertexboneassignm…
</boneassignments>
</submesh>
</submeshes>
<skeletonlink name=“Cube.skeleton”/>
</mesh>
[/xml]
This is the result of exporting from blender, which loads the models but the animations are not played.
[xml]
<?xml version=“1.0” encoding=“UTF-8”?>
<mesh>
<sharedgeometry vertexcount=“72”>
<vertexbuffer texture_coords=“0” positions=“true” colours_diffuse=“False” normals=“true”>
<vertex>
<position y="-0.359639" x=“1.000000” z="-1.000000"/>
<normal y="-0.932517" x="-0.255354" z=“0.255354”/>
</vertex>
…
</vertexbuffer>
</sharedgeometry>
<submeshes>
<submesh usesharedvertices=“true” material=“missing_material” use32bitindexes=“False”>
<faces count=“36”>
<face v1=“0” v2=“1” v3=“2”/>
…
</faces>
</submesh>
</submeshes>
<skeletonlink name=“Cube.skeleton”/>
<boneassignments>
<vertexboneassignment vertexindex=“0” weight=“1.0” boneindex=“0”/>
…
</boneassignments>
</mesh>
[/xml]
as you can see, there are different tags, order and some of the tags are outside in my export
Is there a way to have many animations in one single file? just like Oto’s? I mean, using blender and this export ogre tool.
or should I have to manually take the animations from individual exports?
Cheers!