Write Defaults

While working on ComboGestureExpressions 1.4, I had a lot of struggles with Write Defaults OFF. I have consolidated everything I’ve learned along the way on this page.

⚠️ The article below was written in March 2021.

Research on this subject has evolved since then, and as of September 2023, I recommend you read this other article instead.

https://notes.sleightly.dev/write-defaults/

Animating non-muscle transforms

Write Defaults is a tricky topic. According to the VRChat Documentation, it recommends that in general:

For Transform animations to work in the Gesture Playable Layer:

However, that is not sufficient. Transform animations in the Gesture Playable Layer will not animate if there is at least 1 layer in the FX Playable Layer that match these two conditions:

Additional notes about non-standard configurations: The above is true regardless of whether the Gesture Playable Layer uses Write Defaults OFF. Also, if a layer in the FX Playable Layer only has states with Write Defaults ON, it should not interfere so it doesn’t need a mask.

Creating an Avatar Mask for the FX Layer

We need to create an Avatar Mask to add in the layers of the FX Playable Layer that match those two conditions. However, that Avatar Mask needs to be crafted carefully:

All of the above are implemented in the Avatar mask generator provided in ComboGestureExpressions by clicking Add missing masks.

Please note that the default Avatar Mask editor in Unity is not flexible enough to properly build an Avatar Mask that follows the above rules, as it does not have a facility to let you insert arbitrary transforms. If you don’t use the Avatar Mask generator in CGE, you may have to create it using a Debug inspector.

There is an unknown:

Quirks

⚠️ The article was written in March 2021.

Research on this subject has evolved since then, and as of September 2023, I recommend you read this other article instead.

https://notes.sleightly.dev/write-defaults/

There are additional precautions that need to be taken for Write Defaults OFF to function properly, but it is outside of the scope of ComboGestureExpressions. This list may not be totally accurate:

The following are good practices that may not impact Write Defaults OFF but could be noteworthy: