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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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
  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.
  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
  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.
    tonytopper, kodra_dev, M4R5 and 3 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.
    tonytopper and swingingtom like 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.
    tonytopper and kodra_dev like 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.
  19. Ben_at_Work


    Mar 16, 2022
    I just found my new least favorite feature of Unity! I'm sure second and third place won't mind since they're likely animation related as well. The intended workflow is unintuitive, buried, and unexplained. I would never have found it or known it existed if not for this post.

    Here's my best summary of what I learned today. I'm not an animator, so if this isn't quite right feel free to correct it.

    is presented explicitly as an interaction between animation layers, yet it appears to sabotage itself before it gets a chance to apply that totally normal behavior. Rest assured, it will add correctly... but only after you manually assign a reference pose within the context of the layer (unless you happen to like the weird default?). I personally expected the default to just be zeroes for everything, because that would make sense and allow me to proceed without the extra step. That's not the case. There is a zero involved, but not the one you're hoping for.

    The default reference pose is the first frame of each animation clip (time = zero). If, like me, your animation clip doesn't begin with or pass through a base pose, or if it's a single frame state relying on transitions to blend, this default unusable. You could restructure your whole set of animation clips, or you could assign a pose manually.

    Your custom reference pose should instead be a single frame animation clip capturing the values your clips relate to. If you're like me, you might include every layer that gets touched and set them all to zero. Unity makes no effort to explain how this process is handled, or even that it should be handled. Keep in mind that this pose is relative to the current layer only, so you don't necessarily need to pack it with an entire T-pose or all of your settings across the entire animator, though it might be easier.

    The advantage of the custom reference pose is that you only need to maintain it once across all animations in the layer and you can change it later on to increment default values while preserving the offsets in the animation clips. I assume the default pose must be maintained across every layer. I'm sure there are plenty of animation styles where that behavior is fine and dandy, but we wouldn't be here if we were using them.

    To assign the reference pose, you need to select all animation clips used in the layer and set the inspector to Debug mode. Unity made a dumb dumb and buried core features where you'll never ever find them and didn't leave so much as a ransom note to let you know where to dig. Assign the pose to Additive Reference Pose Clip, then enable the Has Additive Reference Pose toggle. Now your animations will use the values contained in the custom reference pose to finalize the layer's internal values.

    When it comes to actually adding between layers, as the original workflow implies, the principles appear to be what you'd expect. The internal value (animation value - reference value) is added to the external value, which is derived from whatever layers are beneath the additive one. If none of those layers touch the same property, I assume you'll have the same problem you face with override layers when a property is only sometimes assigned.

    ** Slight differences for imported animation clips versus standalone files. Looks to require copying to standalone clips.
    ** Not sure how an empty animation state behaves since it lacks a clip to assign poses to.

    Things Unity should go ahead and fix several years ago:
    1. Expose the additive reference pose settings. Relate them clearly to one another.
    2. Improve the tooltips for the additive blend mode and point users to the relevant animation clip values.
    3. Allow a layer-wide default reference pose to be assigned in the same panel as the AvatarMask.
    4. Add a toggle that switches between using first frames and zero values as the default for a layer.
    5. Provide a solution for imported animation clips.
  20. kodra_dev


    Oct 31, 2022
    And as far as I know, there is no way to set the reference pose at runtime since AnimationUtility is an editor time stuff.

    Anyway bad design is the norm for Unity, so that's expected.
  21. tonytopper


    Jun 25, 2018
    +1 to fix the usability of this feature.

    The Animator is such a powerful and needed tool. It's more than a shame that the user experience is this poor.

    It all feels even more half-baked when you are using the 2D animation sprite rigging tools with it.