Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 2 of 2 (45 posts) < Previous 1 2

Skinned Animation - Creating clips in Maya

Last post 5/27/2012 11:59 AM by dalemo. 44 replies.
  • 5/21/2007 1:30 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    Actually for me it's not even exporting them as multiple animations.  Everything is coming out as one large animation, which is just the entire timeline.  I got an email recently from an XNA user claiming he knows something about this issue.  I asked him to send me details and hopefully I will get them soon.  When I figure this thing out I will be sure to post a good tutorial on my website.
  • 5/30/2007 1:02 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    I've started looking into this, too. What seems to be the case is that the exporters available (for Max, and probably for Maya as well) just dump everything in the timeline to the default "Take 001". What I would bet is that this info is intended to be brought into MotionBuilder (for which the FBX format was originally created, I think). Once in MotionBuilder, animators break the large "Take 001" into smaller sections, which MotionBuilder can then write out as multiple takes.

    So one approach for splitting the large "Take 001" into useable clips in XNA is to create an XML file defining which frames comprise the shorter animation segments, and then read those frames from "Take 001" into individual AnimationClips.

    There is a sample of this (reading ranges specified in an XML file) in the Xclna animation component library here. Be aware that this doesn't use the Microsoft skinning sample -- it uses its own content importer and processor. But the parsing of a large chunk of animation data into smaller chunks minght give some idea of how to approach this.

    Derek
  • 6/5/2007 10:41 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    When I have a little bit of extra time I will create an app that will combine the animations of multiple FBX files with the ability to set their names and location within the timeline.
  • 6/5/2007 2:21 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    That would be excellent! I look forward to the tool. Thanks, lynch3!

    Derek

  • 9/1/2007 11:27 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    I'm curious if anyone has gotten anywhere with this. To share what our team has done, we have exported multiple FBX files each with their own take. When exported, we used FBX w/ Ascii out of Maya. We then manually edit the contents of the FBX in GSE and rename our takes. As well, we then add all of our takes to one file. Then in game, we simply call our clip name from our list of clips in our FBX file. As you can see though, there is a lot of manual editing.

    A better solution would be to figure out how to seperate animation and models. That way there is no redundant data. You simply loaded a rigged character for example then export animation only files or clips to play on that character.

    Hopefully there is a better solution.

    -gameD3V
  • 9/18/2007 4:37 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    Hey guys,

    In our company I've been assigned a Maya designer to convert a model into a "basic" demo game to pitch for funding.  We've managed to replace the skinnedsample dude with our character.

    Unfortunately we get the error thrown by the

    if (skinningData == null)
                        throw new InvalidOperationException
                            ("This model does not contain a SkinningData tag.");

    This is a bit frustrating... obviously.  However, this thread is important and wanted to see if anyone has managed to get the fbx exporting working appropriately out of MAYA 8.5

    For the Content Model, we have set Content Processor to Model - XNA Framework, I did try it set to SkinnedModelProcessor but to no avail.

    I believe that the model has been "baked" before export, but what we really need is a bit of a "dummies" guide to getting it started, then we can run from there.

    We've managed to import the model into XNA by simply replacing the wedge with our current model, so we know that works.

    Any help would be apprecaited.

    Kiora from New Zealand

    Clinton

  • 10/31/2007 3:40 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    I can export out of Maya 8.5 and get animations to work.  The FBX exporter is a little picky however, so you will have to lookout for random nodes maya might have thrown into your file due to history.  If you export as asci you can open up the FBX file and get a better idea of what might be missing.  Also, if you have multiple animations you're going to have to export them individual as FBX asci files, then cut the animations from one and paste it into the main FBX file.  You can also rename your animations that way.

    Another thing to note.  If the animation was baked to the vertices (not the joints) it will appear to be unskinned.

    I wouldn't mind taking a look at your model and locating the issue if you need.  Your best bet for catching me is the #xna Efnet IRC channel.

    Edit: Just noticed I reiterated a few things someone posted a couple posts above me.

    Also, I have not had time to create the tool for combining animations due to project deadlines creeping up on me.  Hopefully I will be able to get to it soon.  Maybe even this weekend.
  • 11/13/2007 2:40 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    Guys,

     I’ve been trying to export my animated models into fbx format with no such luck.  I’ve tried exporting with Maya 8.5 and Maya 2008 with and without the latest plug in.  To make matters worse I can import and export the “dude” model just fine.  I think I am creating my animated models incorrectly.  Can one of you guys explain how to rig a sphere with very basic animation properly for the XNA exporter?

    Thank you to whomever in advance,

    Sean

  • 11/16/2007 3:35 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    My artist figured it out, it seems you have to very careful when baking the animation in the model.  Thanks guys for posting your problems.  I know how how to do mulitple animation in one object, even if it is by hand, its better then nothing.

    Cheers

    Sean
  • 3/7/2008 9:43 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    I had to bump this as i've run into the same problem. i can't name my animation clips in maya. my artist is able to use the trax editor to name them, but the export always calls the entire timeline Take 001.

    In addition to Maya, i also use Blender. Blender's action editor makes it easy to name animation clips, and they all end up in the same fbx on export. There's a small problem though. I can't get the fbx files to show up right in XNA. the content pipeline seems to like them, and i get all my clips with the right names, it's just that the mesh seems to be a tiny garbled mess. That mess appears to run through the correct animations though.

    When i try to import the Blender created fbx file into Maya, i can see it just fine and the animations play correctly. The limitation i notice on maya is i can only import one take from the Blender fbx. I kind of think it's Autodesk's way of pushing Motion Builder.

    So carry on editing the ASCII fbx files.

  • 1/13/2009 11:50 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    Sorry for resurrecting an old thread (again). Just thought I'd let everybody know of a workaround I just implemented. I think this is a problem with Maya, it doesn't support multiple different animation clips very well. I had the same issues when working with Ogre 3D. So what I've done is just created a text file which lists all the sub-animations and what frame they start and end at like this:

    "run" 1 24
    "reverse" 101 124
    "holdmg2hands" 201 201
    "firemg2hands" 201 225
    "reloadmg2hand" 225 280
    "holdmg1hand" 300 300
    "firemg1hand" 300 324
    "reloadmg1hand" 325 365
    "jump" 401 418
    "land" 419 430
    "hitfrontright" 501 512
    "hitfrontleft" 512 524
    "dieballs" 601 634
    "dieflyback" 650 675
    "holdrl" 701 701
    "firerl" 701 715
    "reloadrl" 716 750
    "holdkatana" 801 801
    "attackkatana" 801 820
    "blockkatana1" 850 855
    "blockkatana2" 875 880
    "holdcocktail" 901 924
    "smokecocktail" 925 949
    "throwcocktail" 950 970
    "lightcocktail" 975 988
    "holdshotgun" 1001 1001
    "reloadshotgunstart" 1001 1013
    "reloadshotgunmiddle" 1013 1024
    "reloadshotgunend" 1024 1040
    "fireshotgun" 1050 1075
    "settingsanim" 1101 1148
    "holdshock" 1201 1201
    "fireshock" 1201 1215
    "dieflyforwards" 1401 1420
    "diesideways" 1450 1474


    Then modified the content processor to read this file and use the information to split up the "Take 001" animation into these sub-animations. To do that I added the following functions:

            Dictionary<string, AnimationClipContent> SplitAnimations(AnimationClipContent rootAnimation, string animationDefs)
            {
                Dictionary<string, AnimationClipContent> splitAnimations = new Dictionary<string, AnimationClipContent>();
                StreamReader fileReader = new StreamReader(animationDefs);
                while (!fileReader.EndOfStream)
                {
                    string line = fileReader.ReadLine();
                    string [] parts = line.Split(' ');
                    string animName = parts[0].Trim('"');
                    int startFrame = int.Parse(parts[1]);
                    int endFrame = int.Parse(parts[2]);
                    splitAnimations[animName] = ExtractAnimation(rootAnimation, startFrame, endFrame);
                }
                fileReader.Close();
                return splitAnimations;
            }

            AnimationClipContent ExtractAnimation(AnimationClipContent rootAnimation, int startFrame, int endFrame)
            {
                TimeSpan startTime = ConvertFrameNumberToTimeSpan(startFrame);
                TimeSpan endTime = ConvertFrameNumberToTimeSpan(endFrame);
                List<KeyframeContent> keyframes = new List<KeyframeContent>();
                foreach (KeyframeContent keyframe in rootAnimation.keyframes)
                {
                    if (keyframe.time >= startTime && keyframe.time <= endTime)
                    {
                        KeyframeContent newKeyframe = new KeyframeContent(keyframe.bone, keyframe.time - startTime, keyframe.transform);
                        keyframes.Add(newKeyframe);
                    }
                }
                return new AnimationClipContent(endTime - startTime, keyframes);
            }

            TimeSpan ConvertFrameNumberToTimeSpan(int frameNumber)
            {
                const float frameTime = 1000f / 24f;
                return new TimeSpan(0, 0, 0, 0, (int)(frameNumber * frameTime));
            }


    It's not ideal, but it's better than manually editing the .fbx file every time you want to export it.

    Hope that helps. If anybody else found a better solution please let me know.

  • 1/16/2009 10:34 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    I'm looking into creating animated models in Maya. So tell me if I'm understanding correct: You create clips using the Trax editor in Maya, export the model, and the animation data sticks with it?
  • 4/27/2009 9:57 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    I for one am NOT sorry for resurrecting this thread, this is a problem many people seem to be facing.

    Thank you for your work SpaceDude, so far that's the cleanest solution I've come across, and just wanted to let you know it's likely I'll be implementing that, if that's alright of course.

    For the record guys, you STILL have this problem with .x exporters, for example I've tried both the directx2007 maya exporter and cvxporter, neither output clips correctly. BUT, they give you the opportunity to name and specify very time range every time you export, so THAT sucks too. Grumble Grumble. Unless I'm mistaken, you're stuck either using a very smart solution like SpaceMonkies, or modifying a maya exporter to read the data from maya pertaining to clips properly.

    Plus this leaves me with the impression that there's nothing our buddies at XNA can do about this.

    Bah.

    Anyway, thanks again
  • 7/22/2009 10:38 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    Always fun to bring old threads back to life =). I've sucessfully built a custom Maya (ASCII and Binary) Content Importer. I ended up doing this because the X and FBX exporters for Maya suck to say the least. Another huge benifit is the pure MEL/C# workflow, and no need to work with messy exporters in C++. I doubt that the XNA team will be able to do much about this unless they started created exporters for all of these applications, which would be unrealistic. In my importer, I create a direct link between Maya and the XNA Content Pipeline. I can then execute MEL script to extract out the information I need. So far I am sucessfully importing models, UV sets, color sets, normals, and more. While doing this I get a collection of clips in the trax editor and import all of the clips (I'm going to add poses, and eventually run-time classes so I can control animations in a trax-editor like fassion). Since I am accomplishing all of this in an importer - it leaves you free to hookup to any processor of your choice. If anyone is interested in taking a sneak peak or assisting me with finalizing the importer shoot me a message.
  • 8/16/2009 2:47 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    KentDub:
    Always fun to bring old threads back to life =). I've sucessfully built a custom Maya (ASCII and Binary) Content Importer. I ended up doing this because the X and FBX exporters for Maya suck to say the least. Another huge benifit is the pure MEL/C# workflow, and no need to work with messy exporters in C++. I doubt that the XNA team will be able to do much about this unless they started created exporters for all of these applications, which would be unrealistic. In my importer, I create a direct link between Maya and the XNA Content Pipeline. I can then execute MEL script to extract out the information I need. So far I am sucessfully importing models, UV sets, color sets, normals, and more. While doing this I get a collection of clips in the trax editor and import all of the clips (I'm going to add poses, and eventually run-time classes so I can control animations in a trax-editor like fassion). Since I am accomplishing all of this in an importer - it leaves you free to hookup to any processor of your choice. If anyone is interested in taking a sneak peak or assisting me with finalizing the importer shoot me a message.


    I don't know how far you got with your importer/ exporter but I would like to help you out at least testing a bit the tool.

    this is my email.

    jeremie.mangue[at]gmail.com
  • 8/16/2009 6:52 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    I got pretty far - still working on it as I need features. So far it will import skinned models w/ their bones. I still am playing around with trying to figure out the best way to get the animation data (sample it every frame, some frames, when it detects a maya keyframe, etc.) I'll shoot you a copy of what I have so far though.
  • 3/20/2010 11:49 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    Hi Lynch3,

    I was encountering the same issue when exporting my 3D model from 3DS Max to FBX format. 

    I am a beginner here with all of this field, but what I did to work around this issue is:

    Workaround:
    1- Exported 1 animated model that has the "Walking" clip.
    2- Exported the same model with a different animation "Running".
    3- I exported them both using a ASCII format (Text format), I copied the "Takes and animation section" code
    4- and then I opened the first FDX file, and pasted and appended the second take underneath the the first take, and renamed it  "Running".

    That worked for me for now.

    Example:
    Takes:  {
        Current: "Walking"
        Take: "Walking" {
            FileName: "Take_001.tak"
            LocalTime: 0,60042005400
            ReferenceTime: 0,60042005400
            ....

           }
             }
    Take: "Running" {
            FileName: "Take_001.tak"
            LocalTime: 0,93911854600
            ReferenceTime: 0,93911854600
            ....
           }


    Let me know what you think about this!
    Thanks!
            
  • 3/21/2010 12:14 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    I don't know if anyone here is using it (we're not anymore) however XNAnimation's Skinned Model Processor has an option to specify an XML file with animation names and frame numbers to split the animation up into clips when it's processed/imported. Not as nice as having working FBX exporters and clip support in Max and Maya but it does the trick. The XNAnimation sample project has an example.
  • 6/28/2011 5:56 PM In reply to

    Re: Skinned Animation - Creating clips in Maya

    Hey all, thanks for all the info, we're just starting out working with 3d in XNA, so glad to see we're not the only ones feeling stuck at this time.

    SMCvey, do you have the process you all used when baking the animation?

    I've worked with 3d, and successfully gotten alot of animated characters into the XNA engine before (altho I am just the artist, this was handed off to the dev for implementation).  Currently, we are working with new models, which will not import correctly, and I wonder if this is an issue with the baked anims, or something I missed in the export.  The old file still works fine, altho one difference I noted on the new one, in the structure, is new one has a root joint at 0, 0, whereas the old one did not.
  • 5/27/2012 11:59 AM In reply to

    Re: Skinned Animation - Creating clips in Maya

    (Splitting the large "Take 001" into useable clips in XNA is to create an XML file defining which frames comprise the shorter animation segments, and then read those frames from "Take 001" into individual AnimationClips.)

    how to do that? Is Maya has a role in that?
Page 2 of 2 (45 posts) < Previous 1 2 Previous Discussion Next Discussion