XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

How to import animations that use constraints and expressions in XNA?

Last post 2/18/2008 1:47 AM by toglia. 5 replies.
  • 2/8/2008 3:08 AM

    How to import animations that use constraints and expressions in XNA?

    Hi, I have this robot like animation that uses joints, expressions and constraints to achieve a very specific movement.

    The character itself is not skinned to the skeleton instead I used constraints to attach pieces to the joints because I needed all moving parts not to deform.

    The thing is I have no clue on how to make this to work on XNA. I know I have to export the animation using the bake option, but if I try replacing my fbx model (baked) on the SkinningSample I get some runtime bone error with the pipeline.

    Has anyone worked with baked animations in Xna? Can I do this using the SkinningSample?

    Thanks!!!
  • 2/8/2008 11:36 AM In reply to

    Re: How to play animations that use constraints and expressions in XNA?

    What exactly is the error you are getting?

    It shouldn't make any difference how you created the animation: the FBX exporter will convert this into a simple list of keyframe matrices regardless of what kind of constraints you originally used to construct it.
    XNA Framework Developer - blog - homepage
  • 2/9/2008 10:36 PM In reply to

    Re: How to play animations that use constraints and expressions in XNA?

    Hey Shawn,

    I have a fresh install of the XNA game Studio 2 and just downloaded the new Skinned Model Sample (dude walking) GS 2.
    First thing I did was to add my fbx file to the Content of the project and simply exchanged:

    Content.Load<Model>("dude");
    line for:
    Content.Load<Model>("robot");


    I'm getting this:
    This model does not contain a SkinningData tag.
    on
    if (skinningData == null) line

    I export the fbx file with all default options except I bake the animation.

    As I said before I didnt "skin" the robot body to the skeleton, I used constraints cause I didnt want any deformation, maybe is because of that.

    I will try to make a smooth bind with max weight, to see what happens...

    Is there a way of importing the animation as I have it done? Just using the skeleton to make constraints to it, and having some expressions interact with the whole movement.

    Thanks again.

  • 2/10/2008 2:06 PM In reply to

    Re: How to play animations that use constraints and expressions in XNA?

    toglia:

    I'm getting this:
    This model does not contain a SkinningData tag.
    on
    if (skinningData == null) line

     

    This means you did not assigned the custom model processor after switchinh the fbx file. You have to go to the properties panel (with the fbx file selected) and assign the "SkinnedModelProcessor" under Content Processor property.

    If you look at the SkinnedModelProcessor class, you will note it assigns all the animation data to the Model.Tag using a SkinningData object. You will get an error if you use the standard Model Processor (as I guess you are doing) because Model.Tag will always be null.

    Hope that helps.

  • 2/10/2008 11:44 PM In reply to

    Re: How to play animations that use constraints and expressions in XNA?

    Cosmos, thanks for that, it compiles now and I get to see the blue window, the thing now is that I cant see my model at all. I try zooming, and rotating the camera in case my model is too small or is way offset but nothing.

    My test was:
    1 joint, 1 poly cube, a point constraint between the joint (parent) and cube, and I animate the joint moving up and down.

    I use the "bake complex animation" check, did what you said about modifying the Content Processor to "SkinnedModelProcessor", compiles ok, window comes up, no model.

    If I instead of the point constraint use a Smooth Bind with the default fbx export (without the bake) the xna SkinningSample shows the animation perfectly.

    Any ideas why I cant get to see my super simple constrained animation? Is there anything I'm missing?

    Thanks for your help.
  • 2/18/2008 1:47 AM In reply to

    Re: How to play animations that use constraints and expressions in XNA?

    Answer
    Reply Quote
    I got it solved...

    It is necessary to attach the mesh to the skeleton using "smooth binding" (in maya) for any exporter to work properly. Constraints can be used to manipulate the joints but in some cases it doesnt work right.

    In the other hand, joints moving with expressions export perfectly using the bake option.

    AT
Page 1 of 1 (6 items) Previous Next