đź•’ 5 Minute Read

Last Updated: Sept 3rd 2023


Contributors: Jellejurre


Write Defaults

Write Defaults is an option on Animator States, and a headache for many Avatar Creators, as they behave in weird and unexpected ways. The expected behaviour is as follows:

The Write Defaults field decides whether or not the changes made with this animation are persistent or not.

If the Write Defaults field is enabled, the animated fields will return to their default state upon leaving the Animator State.

If the Write Defaults field is disabled, the changes will stay.

By default, Unity enables Write Defaults on newly created states, but the sample Animator Controllers VRChat provides are Write Defaults Off.

The default animator state, which defaults to Write Defaults on.

The default animator state, which defaults to Write Defaults on.

Example:

If you have a hat that is disabled in the hierarchy when starting the upload process (a.k.a. off by default), and you have a Layer that looks like this:

Untitled

In the case of Write Defaults On:

In the case of Write Defaults Off:


Guidelines

There are a few guidelines to follow when using Write Defaults Off. Afterwards I will explain why these guidelines exist, just for completeness’ sake:

<aside> ⚠️ If you have to use masks due to WD off Transform animations in both your Gesture and FX layers, you can’t use matswaps on any slot but the first one, since a masked transform (whether it’s masked on or off) can’t have animated matswaps apart from the first material slot.

</aside>

<aside> 💡 A useful tool to check if you are breaking these rules (at least the first and third rule) is the VRLabs’ Avatar 3.0 Manager.

In the Write Defaults tab of this tool, it will tell you if you have mixed Write Defaults and set them for you if you press the corresponding button. Do note that it doesn’t make an exception for Direct Blend Trees, so their animator state has to have (WD On) in its name to mark it as Write Defaults On.

</aside>

An example Animation Clip to ensure no empty States remain.

An example Animation Clip to ensure no empty States remain.

By JustSleightly