Animations for same skeleton, different objects, blender question

Hi,

The following question is about workflow in blender and jme3. The problem is this. I have a game character. The character is rigged and has animations on it. The character will be able to wear many different clothes.

Now I can create a file have single Armature and parent to it the character and all the clothes. But this is not sufficient solution. What I would want is to have each piece of clothing to be in a separate file. Now, I can do this by creating the clothing in the file with character and then import the clothing with Armature to a new file and save it.

However this has one flaw. When I create a new animation for the character I would have to edit each file. So even this solution is not sufficient.

My question is how shall I do this so that I can easily add new animations and objects without having to edit existing ones. In other worlds, how can I have one single Armature which contains all the animations to which I can add all the objects I need to in code?

Thanks for the help :slight_smile:

I would :

  • create a rig in blender and make some animations.

  • create all my models using this exact same rig.

  • export the first model to JME

  • turn it into a j3o, you should have a node with and animControl and a skeletonControl and the model geometry(ies) attached to it.

  • remove the geometrie and save the file : this is you rig file.

  • export every single model

  • for each model torn it to j3M, remove the AnimControl and SkeletonControl from them and only keep the geoms.

  • in code, load de rig.j3o, then load one model, add the geometries from the model to the root Node of the rig.j3o file.

This should work, target geometries will be automatically gathered by the skeleton control and providing you used the exact same rig, pieces should get together.

3 Likes

Hi nehon,

thanks for your answer. I almost got it working. I created a rig .j3o file just as u said. Then i created another .j3o file for mesh.
Now here is where I am stuck. If i load rig and put the mesh into right place all shows, but the animations do not work.

To find the error i did this. I saved the created node with binaryexporter. Then I viewed it inside the viewer and there the animations worked! :woot:
Then I did the following. I simply copied the mesh in the editor, came to rig file and pasted it on right place. The result the animations did not play. Then i closed the file and opened again. The animations now did play!

So what i guess is I need to somehow refresh the stuff to work.

mhh yeah seems that something is done during deserialization that should be done when you set the geoms…
Look at what is done in the skeletonControl and AnimationControl read method. I’ll look into it on my side tonight.

1 Like

mehehe thanks, finally got it to working. Inside the SkeletonControl the Mesh[] targets wasnt updated. So in the easiest way i needed to call just about this
rig.getControl(SkeletonControl.class).setSpatial(null);
rig.getControl(SkeletonControl.class).setSpatial(rig);

Now it works XD

1 Like

oh wait you’re using RC2, right?
I’ve fixed a similar issue with hardware skinning, so in nightly you shouldn’t have to do that.

anyway, I’m glad it’s working that’s pretty useful to have one rig and a set of anims for every models.

yea RC2, interesting, maybe ill check the nightly one sometime

but for now, back to a lot of modelling :smiley: