Search Unity

Maya Animations : How to show?

Discussion in 'Editor & General Support' started by CryingRaven, Jun 8, 2006.

  1. CryingRaven

    CryingRaven

    Joined:
    May 3, 2006
    Posts:
    26
    Hi again

    Could someone PLEASE tell me how I get an animated mesh to display as animated?

    I do not have motion builder so do everything in Maya directly using the name@description.mb format. I have been trying for hours now using every setting I could think off.

    In my previous post it seems my models don't get updated so perhaps that is the problem, but just in case it isn't, please save me from another few hours of trying one setting after the next... please!

    Should I import my .mb files with import settings set to Animations in joint or root and should I bake it in Unity when I have already baked it in Maya?

    If I have a base shape that is not animated and in the same directory all the animation files, do I have to:
    a) add a filter or something to the base shape and add each anim to it or does it automatically find matching anims?
    b) Do I need to place the base shape in my game to see it play the first animation it found or will it not play anything if it is not animated itself?
    c) Should I put the base shape in game and call my first anim by script or
    d) should I delete my base shape completely and simply use the idle animation as the base shape?

    i have been trying all the options above (except the filter. I can't seem to find such an option...or at least I cannot add anything to what I think is this option...) and have had absolutely no luck.

    Any advise would be greatly appreciated

    Thanks in advance
     
  2. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    It seems like a blow-by-blow "how to get an animated figure from Maya to Unity" tutorial would be pretty handy ;)
     
  3. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    I tend to agree...
    Joachim suggested I send a bug report to better diagnose it but at my school we have a permissions issue that kills the bug reporter. He then said to send the console log in an email, but I cant find it. Does anyone know where it is within the hard drive/Unity folders?
    My particular issue is a walk cycle that only the top half of the character moves proper(Using Maya7)
     
  4. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Setting it to root works for me. And You only need to bake the Animation if there is IK on your character. I wouldn't bake it in Maya at all... My guess is that might be your problem right there.

    Add in "Character.mb" and script other animations to play using the "Character@Animation.mb" naming method.
     
  5. CryingRaven

    CryingRaven

    Joined:
    May 3, 2006
    Posts:
    26
    I read in another forum post that a person with IK models had to bake the model to get it to work so I naturally assumed he meant in Maya.

    I will give this a try. Thanks!

    Just one thing, though, in the docs it states that you simply save a maya file and place it in the game and it will be animated. Is it really necesary to do it via script?

    Or perhaps motionbuilder multi take animations play the first clip automatically?
     
  6. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Well, if you have more than one animation for a Character then of course you need to script what animation to play and when. If you just have the one animation then selecting "Play Automatically" should do the trick.
     
  7. CryingRaven

    CryingRaven

    Joined:
    May 3, 2006
    Posts:
    26
    See I thought multitake anims automatically play the first one and when using separate files, they automatically get imported into the base shape and the first one found (thus alphabetically) would auto play. If not, then why the autoplay feature?

    This is the reasoning I followed after asking myself the same question: How does Unity decide which of my many anims to play automatically?

    So now on to another question. This is a noob question though, but this is because I am new to anims... lol

    Okay, I saw that you select which anims to play and then have to indicate wether it is to loop or clip etc. Now do I do that only once when I select the anim to play or do I have to put that in the Update() function?

    The reason I ask is becuase as I understand it, functions made outside of the 3 update functions (i.e. update, fixedupdate etc.) get called once when the script loads and the updates get called every frame. I would thus assume that to get the anim started I should place it outside the updates but... it feels wierd making functions and never calling it myself. The whole issue of when will it be called bothers me.

    Please verify if this is correct:
    I only place the base model in the scene and leave all the anims untouched in the project dir. I then create a function called foobar() and within it I call the anim to play. When the base shape with the attached script loads, Unity will call the foobar function automatically. Unity will then go look for the anim file in my project dir and load it. Is this correct?

    If this is correct, then it means Unity will always automatically play anims without my need to call an anim command every frame. Great. But where do I place my calls for other anims to play? For example if I press the up arrow, start playing the walk anim, but if I press up and shift play run anim. I assume I will need to place this in my update function or else when will Unity check for a change in key presses. But if I place the above function in my update function then wont I be setting the animation every frame and won't it thus be stuck on frame 1 forever?

    Also, just on a technical note here, when Unity imports anim files, does it simply import bone details or does it load the entire model to replace the base shape?

    Meaning, can I have an empty file called male.mb with no meshes at all and then have all my LOD meshes in the anim files? Or on the flip side of the coin, if I have all my LOD figures in the base file, do I need to have them all in the separate anim files also or can I delete most of them to make the files a bit smaller?