Change a colour or glow
When to use this
Section titled “When to use this”Use a material property when one value of the material should change: a tint, an emission colour that makes a part glow, or a dissolve amount. The material itself stays the same.
To put a different material on the mesh, see Swap materials. To move the value smoothly with a dial instead of switching it, see Add a slider. When you already set the colour in the material's inspector, Add a shape or a colour from where you set it turns that value into a toggle from there.
-
In the Hierarchy, select the object that holds your AvatarDoc component.
-
In the inspector's toolbar, press + Toggle. To add the change to a toggle you already have, select that toggle in the tree instead.
-
In the toggle's panel, type a name into Name, such as Glow, and press Enter.
-
In the toggle's panel, press + Add effect, then Properties.
You should now see a Properties section with an empty row.
-
On the row, drag the mesh from the Hierarchy onto the renderer field. You can also press the small circle at the field's right end and pick it from a list of your avatar's meshes.
-
On the row, press Pick property.
You should now see a list with a search field: Other... first, then the shader's properties grouped by their first letter.
-
Type part of the property's name, such as
emission, and pick the property.On value now holds the material's current value.
-
Set On value to the colour or number the property should have while the toggle is on.
In the picture, 1 is the renderer, 2 the property and 3 the On value.
The property button shows the name the shader gives the property, which can be short, such as Color. Hold the pointer over the button to see the property's own name, such as _EmissionColor. The search finds a property by either name.
The list shows the shader's colours, numbers and vectors. Textures are not in it. A property the shader hides from the material's inspector is not listed either: press Other... and type its name.
The change applies to every material on that mesh that has the property. While the toggle is off, the property goes back to the material's own value. To use another value while the toggle is off, tick Set a value when off. An Off value field appears, starting at the material's current value.
On a Poiyomi material
Section titled “On a Poiyomi material”Poiyomi locks every material when you upload, and a locked material keeps every property at its value unless the property is marked as animated. AvatarDoc reads the marks of the Poiyomi materials on the mesh, and of the materials your AvatarDoc toggles swap onto it:
- When a material does not mark the property, a warning in the toggle's panel says so. Press Mark as animated under the warning. AvatarDoc marks the property Animated (when locked) on those materials, in one Undo step. You can also do it in the material: right-click the property and choose Animated (when locked).
- The Add to AvatarDoc window marks it for you: when you add the property from the material's header menu or the mesh's component menu, Mark as animated for Poiyomi's lock is ticked, and Add marks the property together with the new toggle.
- A property marked Renamed (when locked) gets a new name when Poiyomi locks the material: its own name, an underscore, and the material's name without spaces (other signs and letters outside English become codes), or the locked property suffix set in the material. AvatarDoc writes the value under both names, so the change shows in Play mode and in the game. While the toggle is off, each such material keeps its own value under its new name in the game, so AvatarDoc does not warn that the materials hold different values.
- A material that is already locked keeps the values it was locked with, and the names: a locked material you renamed or copied keeps the name it was locked with. A warning names a locked material that fixed the property: unlock the material, mark the property, then lock it again or let Poiyomi lock it at upload.
- A material variant is locked through the material it is made from, with that material's name and marks. The warning names that material, and Mark as animated marks it there.
- Material swaps made outside AvatarDoc's own material rows, such as your own animations, an AvatarDoc custom animation, Modular Avatar's Material Swap or VRCFury, are not checked. Mark the property on the materials they swap in yourself.
- A tool that copies the materials during the upload, before Poiyomi locks them, gives the copies new names, and the new name of a renamed property changes with them. Set the locked property suffix in the material to keep the name the same.
Check it worked
Section titled “Check it worked”- In the toggle's panel, press On and Off in the Scene preview row (Advanced mode). The Scene view shows the material change. Press Default to stop the preview.
- In Play mode with Gesture Manager, press the toggle in the menu, as in Your first toggle.
If it does not work
Section titled “If it does not work”- Nothing glows: many shaders draw no emission until it is switched on in the material. Switch emission on in the material with a black colour, and let the toggle change the colour.
- The change shows in the editor but not in the game: the shader fixed the property at its value when the material was locked. On a Poiyomi material, follow the warning in the toggle's panel, as in On a Poiyomi material. See the message. Other shaders that lock their materials need the property marked as animated in their own inspector before they lock.
- A warning says no material on the mesh has the property: AvatarDoc skips that row. Pick a property from the list of that mesh. See the message.
Related
Section titled “Related”- Material properties describes every field of the row.
Docs for AvatarDoc 0.7.1