Animated Properties
Once a material is locked, the property values become constant and cannot be changed via an animation clip or by any other means. If you have an animation clip changing the values of locked materials, those clips will not do anything once the material is locked.
If you want an animation clip to change the values of a locked material, you have to set the properties that will be changed to be 'animated'. You can do so by right-clicking the property and clicking Is Animated
.
Not all properties can be animated! If a property cannot be animated, it will not have an Is Animated
option in the right-click menu.
- Texture swaps cannot be animated. This is a Unity limitation.
- Foldouts with toggles may also be animated, right-click to check!
You will be able to edit animated properties in the material editor when the material is locked.
A red background indicates that the property has been set as animated.
Auto Animating
The material editor can tell when you're recording an animation. If you modify a property while recording, that property will automatically be marked as animated, if it can be animated.
Renaming
Animation clips will change the value of the property for ALL materials on the mesh renderer. This means that if you have 2 materials on a mesh renderer and you want a single property to be animated differently between those two materials, it will not work: the animation clips will animate the property on both of the materials, no matter which one you made the animation clip on.
So to fix this, we need to set that property up to be renamed.
What does renaming do?
When a property is set to be animated, during locking, a copy of that property will be created with a new name that has the material's rename suffix attached to the end of it.
For example, if we're renaming a property _MyProperty
and the material rename suffix is foobar
, we'll get _MyProperty_RENAMED_foobar
as the renamed property name.
You won't see any changes in the material editor as the material editor will automatically retarget edits made to the original property to instead change renamed property. If the material is unlocked, the value of the renamed property will be copied over to the original property.
Working with Renamed Properties
You can set a property to be animated by right-clicking on a property and selecting Is Renamed
. All properties that can be animated will also be able to be renamed.
You can right-click on a property and get the name of the renamed property as well. This is useful for tools that can directly target material properties to create animations, such as VRCFury. When the material is locked, the 'Copy Property Name' option will always copy the renamed property name if the property has been renamed.
Material Rename Prefix
The material rename prefix is a small piece of text that will be added to the ending of a renamed property's name. The addition of this suffix is what solves our problem of animation clips animating all property values of the same name as we've now changed the name of the property!
A rename prefix is automatically created as soon as a property is set to renamed, if the material doesn't have a rename prefix.
You may also change the rename prefix to your own desired prefix. You can find the 'Rename Suffix' input field in the 'Advanced' tab.
Examples
-
2 materials
A
andB
with animation sliders.A
is animated andB
is animated and renamed. An animation clip to change the value of theA
animation will NOT change the animation of theB
material asB
has it renamed (only whenB
is locked, of course.) -
2 materials
A
andB
with animation sliders.A
is animated and renamed andB
is animated and renamed. Both have the rename suffixamogus
. An animation clip to change the value of theA
animation slider which WILL change the animation slider of theB
material as both of them have the same rename suffix and they're the same property! -
2 materials
A
andB
.A
has a random property animated and renamed andB
has a different random property animated and renamed. Both are renamed with the rename suffixamogus
. An animation clip to change the value of theA
property will not change the value of theB
property beacuse they're different properties (so it doesn't matter if the prefix is the same across different properties)