Best 3D model/skeletal animation workflow?

What do you fellas use for creating/animating 3D models to be used in JME?  Blender's gone and changed its ridiculous interface yet again and I don't feel like relearning both UV Mapping and animation in its hilariously unintuitive controls quite yet.  If it's the best option I may poke it again, but I'd sooner play with gmax at this point in time.



It looks like skeletal animations are supported in either Collada or MD5 by JME, so anything that can export to that in a reasonably straightforward manner will make me a happy camper.



In my blind rage I was about to make a project based purely on swapping in multiple ms3d files to play animations, but sacrificing skeletal animations (as ms3d files can only contain one animation, so far as I can tell) seemed a pretty big price to pay.  I guess the other alternative for ms3d is to literally have all animations saved as one gigantic animation… shudder.



Anyhow, insight into what the standard 3D mesh->animation->JME-usable file workflow is, or just what your workflow is, would be most appreciated.

Hi Tyrus,



my team uses this pipeline:



Blender -> Ogre BlenderExporter script -> jme OgreLoader



OgreLoader supports skeletal animation.



If you don't plan to use Blender, Ogre Tools page (http://www.ogre3d.org/download/tools)

contains exporters for other platforms.

Please note jme OgreLoader supports only xml mesh files at the moment.

foxat, thanks for your reply :).  From what I read in this thread, the OGRE loader doesn’t support playing multiple animations.  What’s the point of skeletal animation if you can’t play more than one animation per skeleton?  Am I reading this wrong?  I just want the basic functionality of being able to say play animation 1, stop, play animation 2, etc.  That seems like something that ought to be covered, and is pretty easily supported via the Collada format (and I’d think MD5, as well).

Hi Tyrus,


Tyrus said:

From what I read in this thread, the OGRE loader doesn't support playing multiple animations.  What's the point of skeletal animation if you can't play more than one animation per skeleton?  Am I reading this wrong?  I just want the basic functionality of being able to say play animation 1, stop, play animation 2, etc.  That seems like something that ought to be covered, and is pretty easily supported via the Collada format (and I'd think MD5, as well).


for multiple animations I mean the character to animate contains multiple animations and you can select which animation to use. Example code:


    // meshNode is returned by ogreLoader class...
    animationController = (MeshAnimationController) meshNode.getController(0);

    if (isWalkingBackwards() || isWalkingForward())
    {    
       animationController.setAnimation(ANIM_WALK);    
    }
    else if (isStrifingLeft())
    {     
        animationController.setAnimation(ANIM_STRIFE_LEFT);
    }



So you could use MeshAnimationController.setAnimation() to define which animation to play.

The skeleton file generated by Ogre's BlenderExporter contains info about the skeletal animations:


<animations>
  <animation name="Idle" length="0.966667">
    <tracks>
      <track bone="Coscia_R">
        <keyframes>
          <keyframe time="0.000000">
            ...
          </keyframes>
      </track>
    </tracks>
  </animation>
 
  <animation name="Walk" length="0.500000">
    <tracks>
      <track bone="Coscia_R">
        <keyframes>
          ...
        </keyframes>
      </track>
    </tracks>
  </animation>
</animations>



anyway it seems to me at the moment OgreLoader doesn't support animation blending.

You could try the jmetest.ogrexml.TestMeshLoading example.
Open the ninja.skeleton.xml file (src/jmetest/data/model/ogrexml directory) and see the animation elements under the animations parent (attack1, attack2, Climb, etc)

Then try to change the line 207 of TestMeshLoading class:


205:               MeshAnimationController animControl =
206:                        (MeshAnimationController) clone.getController(0);
207:                animControl.setAnimation("Walk");



setting other animations.


Hello,

I'm using the MeshAnimationController to animate my character, but I don't know how to make the character go back to the idle position it was before.

When I use

animControl.setActive(false);

The animation stops, but at the position it is in the moment.

Any ideas?

Thanks

One way of solving it (i'm not saying it's the best, but it works) is if you know the frame where you would like it to end up, and then tell the animation only to stop at that (or those) frames.

Then when you stop the character, it will continue to play the animation until the desired frame, and then stop.



edit: whoops. entered from the front page, so i didn't realize it was a hijacked thread. the reply is aimed at s_tian's question.

The newest SVN version of the OgreXML importer allows dividing armatures into “parts” that can play different animations each (like running and shooting). Have a look at this thread. The blender->ogre way is definitely the preferred one.

s_tian said:

Hello,
I'm using the MeshAnimationController to animate my character, but I don't know how to make the character go back to the idle position it was before.
When I use
animControl.setActive(false);
The animation stops, but at the position it is in the moment.
Any ideas?
Thanks


If you want to reset the animation back to the bind pose you can say animationControl.setAnimation("<bind>"); as it shows here: http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/com/jmex/model/ogrexml/anim/MeshAnimationController.java

I don't do this though for my game because my bind pose is the character with arms straight out, and legs perfectly vertical.  My idle pose is actually a one frame animation of the legs in a aggressive stance.  So instead you could have the animation be set animationControl.setAnimation("Idle"); where "Idle" is a one or so frame animation of the character posed that way.

I think you're all very confused. The importer does support multiple animations, animation blending and animation transitions, as well as attachments and user bone control. If there's a feature missing I am sure there will be many willing to add it :wink:



The only gripe I have with Ogre3D right now is that the OgreMAX exporter (for 3DSMAX modeling tool) is free for non-commercial use only… however all you need is basic mesh export which the old, free importer should handle well.

Hi,

animationControl.setAnimation("<bind>"); worked.

My bind pose is like yours, arms straight out, and legs vertical. Was thinking about changing it. But yeah, making an animation for that is an alternative.

Thanks  :slight_smile: