Search Unity

Write Defaults?

Discussion in 'Animation' started by tborden, Oct 4, 2019.

  1. tborden

    tborden

    Joined:
    Sep 5, 2017
    Posts:
    3
    So I have an animator controller with several layers, and what I've noticed is that if I have a higher layer (further down the list of layers in the UI) in override mode that's running an empty state, checking and unchecking "write defaults" on that empty state has kind of baffling results:
    -If "write defaults" is checked, the layer does not alter the pose coming through from the states beneath it
    -If "write defaults" is not checked, it will write the default pose over top of the results of the lower layers.

    Isn't that backwards? Why does it write the default pose into the blend hierarchy when write defaults is NOT checked?

    I've noticed that if I have a clip in a lower layer that animates a custom property, everything in a higher layer that doesn't animate that property but does have "write defaults" checked will NOT affect the value of that property -- it will hold the value set at the lower layer.

    So, it seems like the "default" value that "write defaults" is actually writing is actually just whatever the value was right before evaluating the state, making "write defaults" effectively equal "don't affect the value of any property that this state doesn't directly animate itself", which is literally the definition of having "write defaults" UNCHECKED, as I understood it.

    I have a custom property I'm only interested in setting to a non-zero value in a handful of specific clips, so I thought that if I had "write defaults" checked everywhere, it would save me having to explicitly add a curve to every single other clip in the game that writes the value to zero. If I want the value of that property to actually be reflective of the actual final animation pose, is that my only option?
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    What's this, someone confused about Write Defaults?

    ShockedPikachuFace.jpg

    Your conclusions (and your confusion) seem reasonable and unfortunately I don't have a solution for you, I just wanted to let you know that you're not alone.

    Edit: you might find something in this thread helpful https://forum.unity.com/threads/write-defaults-confusion-bug.392058/
     
    LudiKha likes this.