Need help for basic animation of an arm

Hello,



I have to make a simple robotic arm for school and be able to animate it.

I modeled the arm with blender, exported the xml and the .scene and converted them into .mesh (ogre). I even made a default animation on blender and exported the .skeleton.

The problem is when I import them into the SDK of jme3 it only shows me the plane(floor) and the sphere (object that the arm must be able to move).

I’m sure I did something wrong but I can’t figure what.





Maybe you have an idea.



Best regards,



rXp>!<



PS : I’m sorry, I’m not in the troubleshooting forum -_-

Check the help of the ogre exporter and make sure to apply all modifiers etc. the exporter can only export mesh data, no otherwise generated objects.

Here it is :

Link to my blender file

I followed every instruction.

The only error is when I export the xml it says (a lot) Warning : Vertex without bone assignment !

I tried the weight paint but it doesn’t changes anything.



Best regards,



rXp>!<

Check the pdf link at the bottom of this page: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset It details how to do a model and export it with blender.

I rerereread the tutorial. But I still don’t know why my arm is not shown but it is imported without any problem.

Maybe should I share the .blend… Where should I upload it ?



Best regards,



rXp>!<

Is there several objects in your blend file?

How do you export : ogre xml or ogre scene?

Anyway if there are several objects you must export all of them and then add them one by one into the scene composer.

I tried ogre xml and ogre scene. Yes there is and I did import them one by one but no luck :confused:

Are you sure you include the objects when you export the scene file?

Yep, the log of JME3 show the importation object by object.

Oh, then maybe you’re just missing a light in your scene because those objects are using the lighting material? Or you have the same bug I have where only one geometry at a time is visible… Do the other objects appear when you move/rotate the camera?

Object always in camera. A simple light is right above them.

Ok, then upload the file somewhere…

Its the vertex without bone assignment error, those meshes dont get exported. Rename the vertex groups to the bone names, then it works.



Edit: btw, how did you get the bones to work without the correct names in the first place??

normen said:
Its the vertex without bone assignment error, those meshes dont get exported. Rename the vertex groups to the bone names, then it works.

Edit: btw, how did you get the bones to work without the correct names in the first place??

You can use other options like bone heat, envelopes, etc which don't use vertex groups.
It should be possible to bake those onto the vertex groups though, maybe through a script

Ok, as I said, for me it works when I just rename the vertex group to bone name. Its generated and everything, so I guess the other assignment forms also use them… just wondering why they don’t name them properly.

1 Like

It’s a robotic arm so if I use heat I will need to “paint” the objects.

Okey now the arm is imported properly :slight_smile:

I just need to make the animation. The tutorial is great, I’m just not sure if the SDK imported the animation of the objects when I imported the scene.

Because I get a nullPointerException after getting the control on one object.

[java]

scene = (Node) assetManager.loadModel(“Models/Scene/Scene.j3o”);

Node arm2 = (Node) scene.getChild(“arm2”);

rootNode.attachChild(scene);

rootNode.attachChild(arm2);



control = arm2.getControl(AnimControl.class);

System.out.println(control.getAnimationNames().size()); //<


nullPointerException
[/java]

EDIT :
That could explain it : [java]arm2.getNumControls()[/java] is equal to 0. But the skeleton file is loaded.

You have to specify which animation you export in the ogre exporter in blender, did you do it?

nehon said:
You have to specify which animation you export in the ogre exporter in blender, did you do it?

Yes, I even checked the skeleton files and they have all the informations, about the bones and the animation.

arm1.skeleton.xml
[xml]<skeleton>
<bones>
<bone id="5" name="base">
<position x="-0.000000" y="-2.509327" z="0.535456"/>
<rotation angle="0.101564">
<axis x="1.000000" y="-0.000000" z="-0.000000"/>
</rotation>
</bone>
<bone id="0" name="body">
<position x="-0.000000" y="1.231429" z="0.018109"/>
<rotation angle="0.000000">
<axis x="0.361427" y="0.932401" z="-0.000000"/>
</rotation>
</bone>
<bone id="3" name="arm1">
<position x="0.000000" y="2.589623" z="-0.416513"/>
<rotation angle="0.000000">
<axis x="0.025819" y="0.999667" z="-0.000000"/>
</rotation>
</bone>
<bone id="1" name="arm2">
<position x="0.000000" y="3.614791" z="-0.115714"/>
<rotation angle="1.570796">
<axis x="-1.000000" y="0.000000" z="-0.000000"/>
</rotation>
</bone>
<bone id="6" name="wrist">
<position x="-0.000000" y="3.658069" z="0.090547"/>
<rotation angle="0.000000">
<axis x="1.000000" y="-0.000031" z="0.000000"/>
</rotation>
</bone>
<bone id="4" name="fingerL">
<position x="-0.787360" y="0.866096" z="-0.000000"/>
<rotation angle="0.000000">
<axis x="1.000000" y="0.000003" z="-0.000000"/>
</rotation>
</bone>
<bone id="2" name="fingerR">
<position x="0.834601" y="0.866096" z="0.000000"/>
<rotation angle="0.000000">
<axis x="1.000000" y="0.000003" z="-0.000000"/>
</rotation>
</bone>
</bones>
<bonehierarchy>
<boneparent bone="body" parent="base" />
<boneparent bone="arm1" parent="body" />
<boneparent bone="arm2" parent="arm1" />
<boneparent bone="wrist" parent="arm2" />
<boneparent bone="fingerL" parent="wrist" />
<boneparent bone="fingerR" parent="wrist" />
</bonehierarchy>
<animations>
<animation name="Action" length="0.680000">
<tracks>
<track bone="arm1">
<keyframes>
<keyframe time="0.000000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.000000">
<axis x="-1.000000" y="0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.040000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.011960">
<axis x="-1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.080000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.048535">
<axis x="-1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.120000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.110892">
<axis x="-1.000000" y="-0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.160000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.200087">
<axis x="-1.000000" y="-0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.200000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.316439">
<axis x="-1.000000" y="-0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.240000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.458641">
<axis x="-1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.280000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.622814">
<axis x="-1.000000" y="-0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.320000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.801980">
<axis x="-1.000000" y="0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.360000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.986501">
<axis x="-1.000000" y="0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.400000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.165678">
<axis x="-1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.440000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.329868">
<axis x="-1.000000" y="-0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.480000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.472082">
<axis x="-1.000000" y="-0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.520000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.588436">
<axis x="-1.000000" y="0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.560000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.677622">
<axis x="-1.000000" y="-0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.600000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.739961">
<axis x="-1.000000" y="-0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.640000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.776520">
<axis x="-1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.680000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.788479">
<axis x="-1.000000" y="-0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
</keyframes>
</track>
<track bone="arm2">
<keyframes>
<keyframe time="0.000000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.000000">
<axis x="0.991278" y="0.049576" z="0.122105"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.040000">
<translate x="-0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.010472">
<axis x="1.000000" y="0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.080000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.042400">
<axis x="1.000000" y="0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.120000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.096494">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.160000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.173195">
<axis x="1.000000" y="0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.200000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="0.272181">
<axis x="1.000000" y="0.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.240000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.391788">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.280000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.528463">
<axis x="1.000000" y="-0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.320000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="0.676539">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.360000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="0.828640">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.400000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.976723">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.440000">
<translate x="-0.000000" y="-0.000000" z="-0.000000"/>
<rotate angle="1.113406">
<axis x="1.000000" y="-0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.480000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="1.233020">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.520000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="1.332008">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.560000">
<translate x="0.000000" y="0.000001" z="0.000000"/>
<rotate angle="1.408704">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.600000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.462790">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.640000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.494706">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.680000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="1.505179">
<axis x="1.000000" y="0.000000" z="0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
</keyframes>
</track>
<track bone="wrist">
<keyframes>
<keyframe time="0.000000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.040000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.080000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="0.017874">
<axis x="-0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.120000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.160000">
<translate x="-0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.200000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.240000">
<translate x="-0.000000" y="0.000001" z="-0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.280000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="0.017874">
<axis x="-0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.320000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.360000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.400000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000001" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.440000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.480000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="-0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.520000">
<translate x="0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.560000">
<translate x="-0.000000" y="0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000001" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.600000">
<translate x="0.000000" y="0.000000" z="-0.000000"/>
<rotate angle="0.017874">
<axis x="-0.000001" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.640000">
<translate x="0.000000" y="-0.000000" z="-0.000000"/>
<rotate angle="0.017874">
<axis x="-0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
<keyframe time="0.680000">
<translate x="0.000000" y="-0.000000" z="0.000000"/>
<rotate angle="0.017874">
<axis x="0.000000" y="1.000000" z="-0.000000"/>
</rotate>
<scale x="1.000000" y="1.000000" z="1.000000"/>
</keyframe>
</keyframes>
</track>
</tracks>
</animation>
</animations>
</skeleton>
[/xml]

I discovered something :

When I don’t try to load the scene but just one object, i.e. : arm1 (the upper-arm) the model that is loaded is red and is always just a basic cube (so not the correct model) BUT the animations are correctly attached to it oO

Maybe that will help you help me.



[EDIT] Here is a screenshot : Left the model when I load the scene and I point to the particular object I tried to load alone later. Right the object loaded alone with animation but not the correct shape.