Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Additive animations not working

Discussion in 'Animation' started by silentneedle, Jul 31, 2016.

  1. silentneedle


    Mar 14, 2013
    Hey Guys,

    I'm currently trying to add additive animations to my character. I've two animations:

    1. Idle (Base Layer)
    2. Hold weapon (Additive layer)

    So from my understanding, as soon I set the weight of the additive layer to 1 the character should play the idle with the hold weapon animation, but instead my character still idles without holding the weapon.

    Is there any special trick to create additive animations?

    I'm using Unity 5.3.
  2. Kim-Nobre


    Jul 26, 2016
    I'm not sure why exactly are you trying to use an "Additive" layer, I usually use an "Override" layer for that, have you tried it already?
  3. silentneedle


    Mar 14, 2013
    Override is working fine, but it doesn't look good when my character is running (the arms are too steady).
  4. Mecanim-Dev


    Unity Technologies

    Nov 26, 2012
    Hi silentneedle,

    How did you created your animation clip?

    Additive clip are kind special, if you import a clip to be used in a additive layer and doesn't setup the additive reference pose, the system will use the pose at frame 0 in your clip as the reference pose.

    There is two way to setup the additive reference pose, when you import your clip you can define a frame to be used as the reference pose
    or by script with

    I guess in your case you have an animation that hold a gun that last 1 frame, so the system use the same frame as the reference frame and the animation to add, since there is no difference between frame 1 and 1 you don't see anything move
    siddharthlabs likes this.
  5. exerion


    Jun 29, 2011
    Hi Mecanim-Dev =D

    Why is the Additive Reference Pose Clip setting not easily accessible for clips created within Unity?

    If I hadn't found this thread I would have continued to think the additive feature in Mechanim was broken.

    For those struggling with this you can additionally set your editor to debug mode to expose the settings when you have an animation clip selected. Don't forget to set the Has Additive Reference Pose bool as well as setting the Additive Reference Pose Clip otherwise it wont work.
    Siliko, oAzuehT, Cylau and 6 others like this.
  6. Dawdlebird


    Apr 22, 2013
    Trying to do exactly this; I have an animation (let's call it "happy", frames 40 to 64) that differs significantly from idle, both clips from a single asset, and have the pose frame for happy set to the first idle frame (and additive reference pose flagged on obviously).
    Unity would have to take happy and substract that idle pose to get the additive difference, right?
    And if if I then play happy as additive onto idle, I should get my full happy animation, right?

    But it doesn't; it seems to just take the first frame of happy as a reference pose, and creates an additive clip based purely on that pose (which is some minimal jitter currently) that gets added onto my idle.
    I would say the result is quite sad instead...
    Am I missing something here?
  7. Dawdlebird


    Apr 22, 2013
    Actually, exerions tip for using debug mode revealed the issue; regardless of what frame is set as a reference pose, the importer will make use of a 'preview' clip based on the clip used as additive animation. Any frame lookup will be done relative to this preview clip. Unfortunately, these additive reference pose clips cannot be set in the animation clips of an asset. The only way to work around this bug is to duplicate these clips to stand-alone assets, and then set the reference pose clip to an idle animation (or whatever animation is to serve as a basis). The downside here is that updating the original asset will not update these duplicate clips.
  8. 5argon


    Jun 10, 2013
    lol lose 2 hours before finding this thread. Additional clarification since this came up the top from Google, important rule :

    Without entering Debug mode, if we have an additive layer with full weight, both base layer and additive layer playing single state

    Screenshot 2019-05-19 15.38.07.png

    Situation 1

    Base layer : single keyframe, looping, position x = 5
    Additive layer : single keyframe, looping, position x = 1

    Expected : constant position x = 6
    Result : constant position x = 5, because the additive layer reference the first frame of itself, which has position x = 1. When it is playing, it is always 1 - 1 = 0 so nothing got added.

    Situation 2

    Base layer : single keyframe, looping, position x = 5
    Additive layer : 2 keyframes, looping, position linearly ramp up from x = 0 to x = 1

    Result : position ramp up from x = 5 to x = 6. Additive layer use the first frame of itself as a reference like before but this time it's x = 0. Overtime we get +0 ~ +1 to the base layer correctly. You can also adjust the total addition with Additive layer's weight.

    Situation 3

    I want to upgrade the ramp, so I made the 2 keyframes that was ramping up from x = 0 to x = 1 to become x = 3 to x = 4 instead.

    Expected : position ramp up from x = 8 to x = 9
    Result : position still ramp up from x = 5 to x = 6. Again, since the additive clip use the first frame of itself as a reference, we get 3 - 3 = 0 ~ 4 -3 = 1 -> still ramping up from +0 ~ +1

    How to make the first situation producing constant x = 6, and the 3rd situation producing ramping up x = 8 to x = 9?

    Make a custom reference clip. It doesn't have to be in the graph, but you should copy from your previous clip so it has a Position keyframe. (If it is not in a graph, you cannot key a new kind of keyframe to it from "nothing", but you could delete keyframes) Make it a single keyframe with 0 0 0 position.

    Screenshot 2019-05-19 15.46.45.png

    Enter debug mode of the additive clip with a single keyframe position x = 1. Connect the zero reference clip and check has additive reference pose check box. Now x = 1 will be 1 - 0 = 1 correctly and not 1 - 1 = 0, and produce a constant x = 5 + 1 = 6 when playing additively.

    Screenshot 2019-05-19 15.47.31.png

    (imo this box should be exposed, especially that I am doing UI animation where there is a lot of single frame animation that I want them added it is not obvious that I have to enter Debug mode.)
    Last edited: May 19, 2019
    jctn_nemo, no00ob, stoppo and 9 others like this.
  9. alanmthomas


    Sep 7, 2015
    I agree that this should be exposed. And thank you so much for this post! I've been trying to get additive blending to work properly and couldn't until I got here. I found a lot of "use override" posts, which really don't do the trick.

    Thanks again!
  10. timmehhhhhhh


    Sep 10, 2013
    Same here - this has been an issue in the past and the solution was usually awkward. Very happy to see an updated thread and have stumbled on this ;)
    stoppo likes this.
  11. MallNinjaMax


    Apr 17, 2017
    Hard to believe they couldn't fathom that people would import/create pose clips for additive poses. Not hard to believe that they would neglect fixing it for this long. I hope people are happy with their Machine Learning and DOTS toys, because the tools are rotting.

    Thanks for the workaround.
    kodra_dev, M4R5, stoppo and 2 others like this.
  12. Discmage


    Aug 11, 2014
    Sorry to bring this up again, but it ties into this and others may have the same thought/issue...

    What happens if my animation on an additive layer is a loop that doesn't 'overlap' the reference animation position/animation? If I 'NEED' an additive reference pose frame (say, frame one) but my character needs to be positioned away from the position of the base animation and is a do I create a reference pose for a loop without having a single frame look like it's glitching because I HAVE to have a reference frame so it knows what to blend from?

    I hope that makes sense?
  13. Biscuitlid


    Apr 1, 2013
    I know this is very late but to do this I:

    1. Set the anim's reference pose frame in it's import settings (for my looping pose)
    2. Duplicated the looping pose
    3. Went into debug mode with the duplicated anim selected like in the above example
    4. Chucked my idle animation in as the 'Additive Reference Pose Clip'
    5. Put my duplicated anim into my animation controller
    And it was job done.

    It's an absolutely garbage process though, and it's embarrassing to see that it's been like this for half a decade!
  14. Lesnikus5


    May 20, 2016
    How do you edit the clip? I enter debug mode but all fields are locked!

    PasVol likes this.
  15. Dawdlebird


    Apr 22, 2013
    Yeah that's the annoying part: you have to make a copy of the clip (ctrl+D), so it becomes a stand-alone asset. Only then can you assign it a reference pose clip.
  16. bearcoree


    Mar 8, 2016
    Is this still the way to do additive layer animations in 2022? Having to go into the debug inspector is so clunky.
    swingingtom likes this.
  17. Xelnath


    Jan 31, 2015
    This is absolutely nuts. It's 2023, why can't we just drag another FBX into here to set this up.
    kodra_dev likes this.
  18. kodra_dev


    Oct 31, 2022
    It's just the Unity's way. Double down on the new shiny buzzword (yeah, they announced Unity AI, whatever that means.) and let the engine die.