Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mecanim, Animations, Skeletons and Avatars. Oh my.

Discussion in 'Developer Preview Archive' started by Jaimi, Aug 29, 2012.

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    I have 2,672 animations in my application. 1388 tied to a male skeleton, and 1284 tied to a female skeleton (The female skeletons have 2 additional bones). I have 8 other skeletons of various proportions that I can use as "base characters" to tied body parts to (I'm hoping to add more).

    Of the 2672 animations, all are exported individually as per the previous recommendations. Since these are individual FBX files, it seems that in order to "retarget" with Mecanim I would need to individually select each animation, and make it create an Avatar (even though they're the same skeleton).

    So my questions are:

    What are the implications of creating so many "Avatars" - ie, memory overhead, processing overhead, etc?
    Is there a way (beyond loading all of the files up in Max, and combining them into one animation) that I can reduce them to just two avatars with all the animations on them (ie, some preprocessing script or something)?

    Also - What are the implications of binding all of these animations to the 8 different skeletons? If I retarget all of these animations in advance to the 8 different skeletons, is there overhead involved if they are not in use? These are skeletons that would be selected by the player, so there will be only one in use at a time.
     
    Last edited: Aug 29, 2012
  2. JamesMakesGamesLtd

    JamesMakesGamesLtd

    Joined:
    Aug 22, 2012
    Posts:
    34
    You dont need to create an avatar for each one, you can use the avatar pose from one of them, for all of them (if the skeletons are the same).

    Select the FBX with the anim you want (an FBX which currently ISNT an avatar), in the inspector click the Animations button, under that in Muscle Definition choose 'Copy From Other Avatar' and pick an avatar from one you've already made.
     
    Last edited: Aug 29, 2012
  3. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Thanks - I see in the scripting reference a function "ModelImporter.CopyAvatarFromOtherModel", Looks like it should be possible in the PostProcessor to get (and save) the Avatar on the first model by getting the Animator behaviour from the model, and it has an as-yet-undocumented GetAvatar() function.

    Still curious if there is an issue with so many Avatars being created/copied. Guess we'll see. :)