Search Unity

Mecanim root motion and additive layer - bug ?

Discussion in 'Editor & General Support' started by Staross, Apr 27, 2013.

  1. Staross

    Staross

    Joined:
    Jan 6, 2013
    Posts:
    51
    So I'm trying to use additive animations with root motion in mecanim. As a test I have an animation with two frames only, my model is in T pose in the two frames (no differences). I added my animation in a new additive layer but when I play the game, my character starts to move side quite fast, as if a constant velocity was applied to its root. I tried to change possibly all parameters in layers and animation import but nothing seems to fix this, I really don't understand what's going on.

    The only thing that seems to work a bit is to add an avatar body mask with ground and feet IK disabled to my additive layer, but then any change to the legs will not be applied. Disabling IK pass don't change anything.

    Any idea?
     
  2. Staross

    Staross

    Joined:
    Jan 6, 2013
    Posts:
    51
  3. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    Hi. Are you using 4.3 ?

    We have found a bug with additive layers that is really similar to your - the fix is coming soon.

    Otherwise please file us a bug with repro.
     
  4. frank28

    frank28

    Joined:
    Dec 30, 2013
    Posts:
    13
  5. SpiralOrgan

    SpiralOrgan

    Joined:
    Jun 30, 2013
    Posts:
    5
    I too been unfortunate enough to face this bug. I'm also waiting for the fix. That's what I get for trying to be clever and keep state machines clean by dividing them up into layers...
     
  6. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    We have just released 4.3.3

    It should fix the problem!

    pp
     
  7. MrScary

    MrScary

    Joined:
    Dec 8, 2007
    Posts:
    94
    pierre: Just installed 4.3.4 hoping the update would fix an additive animation problem I'm seeing.

    I have a base layer, a sync layer ( targeting the base layer), an additive layer targeting bones animated in the first two layers ( this additive animation works correctly) and then I have another final additive layer targeting the same bones as the previous layer with the addition of the head bones. These are look up and look down additive animations (single frame loops).


    The problem is this final additive layer doesn't do anything. It's set up as a New State -> Blend Tree with a float -1 to 1 that blends between the lookup and look down anims.


    Should this be working? do I have it set up correctly? Or is this still broken.

    Bonus Question: how expensive are extra layers and how expensive are additional parameters?

    Bonus Question #2: is it possible to re-order layers, or do I need to keep redo'ing them when I realize I need to add a layer before the additive layers?

    Thanks
     
    Last edited: Feb 4, 2014
  8. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    Hi!

    Can you file us a bug please, I would like to look at it.


    Not currently, but we are working on it! Until then, you can always copy/paste stateMachine between layers..
     
  9. meat5000

    meat5000

    Joined:
    Mar 5, 2013
    Posts:
    118
    @MrScary

    If your final layer is additive then the head motion is becoming watered down by all the layers below it in which the head doesn't move and which have a layer weight >0.

    If the final layer is exclusively for the head up/down then consider making a mask for only the head and neck and make the layer over-riding, setting weight to 1.

    To regain control of the head for other animations you will need the layer weight to be 0.

    Another point is that Unity doesn't like Single Keyframe animations. They will cause a freeze in the import tab! I've also tried making a 2 Keyframe animation with matching frames over 10 frames, but it didn't like that either. For this to work, instead of Tree-Blending between [look up][look forward][look down] I believe you will need the three animations to incorporate the full motions then splice then as needed in animation import. (Realistically this is horribly overcomplicating the looking as you can achieve this with a simple curve adjustment from the animation window).

    I tried a similar approach for [walk left][walk][walk right] but eventually the only way I could make it work was by making a full, walk round 360 degrees 120 frame anim for left and right and BlendTree it to the 40 frame walk-forward anim. Curiously, if I only exported the left/right as 40 frames the anims would blend horribly. I had to export the full 120 frames and adjust the sliders to only use the first 40, even though the footsteps were sync'd!


    @Staross
    I also encountered the flying sideways nonsense, which seems to be caused by small migration of the root, which seems to be worked out as an average of the position of the feet? I say this as my anim root only works along one axis in the modeller but the root forward motion tracking arrow in the preview rotates left and right as the feet move. This was solved by performing the walking/turning blend as I mentioned above and playing with bake settings. The two-exact-frame appraoch doesn't seem to work.
     
    Last edited: Apr 26, 2014