The official root repository for this project is here https://github.com/rygo6/GTAvaUtil.
This is essentially a throw bag of utilities for VRChat avatars that I either do not see existing elsewhere, or the other freely available options do it incorrectly.
Join the GeoTetra Discord for support or suggestions about more avatar utilities to be added: https://discord.gg/nbzqtaVP9J
- Open the Unity Package Manager under
Window > Package Manager
. - Click the + in the upper left of package manager window.
- Select 'Add package from git url...'.
- Paste
https://github.com/rygo6/GTAvaUtil.git
into the dialogue and click 'Add'.
All utilities are currently under the Tools > GeoTetra > GTAvaUtil
menu at the top of the Unity Editor. Currently there are only a handful of utility methods.
This will let you bake down Ambient Occlusion on an entire avatar to the RGB vertex colors. This applies certain smoothing parameters as well to give you a very smooth, averaged, ambient occlusion effect. Generally find it superior to what you would get from Ambient Occlusion texture baking in blender, which can be too precise and look odd on avatars with so many moving parts.
- I would suggest posing your avatar into an A pose with its legs spread so the AO shades the under arms and in between the legs better. I would also fully activate the 'aa' blendshape so the mouth is open and AO get inside the mouth.
- Ctrl+Click to select all the GameObjects with SkinnedMeshRenderers and MeshFilters you wish to bake AO onto. It is necessary to select them all and bake them all at once so they occlude each other. Objects not in the selection will not contribute to the occlusion.
- Click
Tools > GeoTetra > GTAvaUtil > Bake Vertex AO On Selected...
. - Wait for baking to finish. It applies the baked colors to the vertex colors of the mesh, saves a new mesh for each, and applies those back to the original SkinnedMeshRenderers and MeshFilters.
You can selectively run Average Vertex Colors On SkinnedMeshRenders or MeshFilters...
on specific meshes to smooth things out further.
Your shader must utilize vertex colors in some way for the result to be visible. This data can be used by the GTAvaToon shader to add Ambient Occlusion to your avatar.
This will bake onto the first selected GameObject the occlusion of subsequently selected GameObject's. It will store this in the alpha channel of the vertex color. The purpose of this is to enable a shader to discard vertices that are not fully visible. You can use this to keep your avatar's body from clipping through the clothes. The GTAvaToon shader supports this via the Discard Vertex AO Darkness Threshold
slider.
- Select the GameObject with SkinnedMeshRenderer or MeshFilter you want to bake the vertex visibility data onto. This would probably be your avatar's body.
- Ctrl+Click to select all subsequent GameObjects with SkinnedMeshRenderers and MeshFilters you want to contribute to occlusion. This would probably be your avatar's clothes.
- Click
Tools > GeoTetra > GTAvaUtil > Bake Vertex Visibility Onto First Selected...
. - Wait for baking to finish. Your avatars shader must know how to use this data for it do anything. The GTAvaToon shader can use this data to discard vertices via the
Discard Vertex AO Darkness Threshold
slider.
This averages the vertex colors on selected Meshfilters or skinnedMeshRenderers, saves it to a new mesh and applies it back to the renderer.
- Select the MeshFilters or SkinnedMeshRenderers you want to average the vertex colors on.
- Click
Tools > GeoTetra > GTAvaUtil > Average Vertex Colors On MeshFilter...
. - Vertex colors should appear smoothed in about a second.
This will let you attach a rigged clothing item to the skeleton of your avatar.
There are other utilities that do this but I found they did it incorrectly. You would end up with a duplicated skeleton for each clothing item or it messed up when the bones weren't in the same exact position.
This utility will attach the clothing item to the actual skeleton of the avatar itself, so then all your clothing items will use the same skeleton and GameObjects that the avatar itself uses.
It also calculates new bindposes in case your avatars bones and your clothing items bones are not in the exact same position.
For this to work your clothing items skeleton and your avatars skeleton must have the same hierarchy and naming. It is not necessary that the skeletons exactly match, but every bone present in your clothing items skeleton must also be present in your avatars skeleton.
Nearly every clothing package for a particular avatar I have bought off of gumroad has been set up like this, so I assume this should just work for most avatar clothing packages.
- First line up your clothing item to your avatar.
- Next, select the SkinnedMeshRender you want to transfer bone data from, this is probably your avatars SkinnedMeshRenderer.
- Next hold down ctrl and select the SkinnedMeshRenderer you want to transfer the bone data onto, this is probably your clothing items SkinnedMeshRender.
- Now click
Tools > GeoTetra > GTAvaUtil > Transfer SkinnedMeshRenderer Bones...
. If it completes without errors then it worked and should have made a new GameObject next to your avatars SkinnedMeshRenderer with your newly attached clothing item. If you rotate the leg or spine of your avatars skeleton, your clothing item should now be properly attached.
This will automatically place a light probe anchor at the average position between all selected meshes.
- Select all the meshes of a single avatar.
- Click
Tools > GeoTetra > GTAvaUtil > Add Probe Anchor From Averaged Mesh Positions...
. - This will make a 'ProbeAnchor' GameObject hooked up to all the meshes. You can better position this afterwards if you wish.
This will automatically recalculate the bounds of a selected set of SkinnedMeshRenderers.
- Select any number of SkinnedMeshRenderers.
- Click
Tools > GeoTetra > GTAvaUtil > Recalculate SkinnedMeshRenderer Bounds...
.
This will let you pose a SkinnedMeshRenderer, set its blendshapes and then bake it out to a static mesh. This I mainly use with the package Zologo VertexDirt to then bake down vertex ambient occlusion on a mesh after I tweaked its blendshapes and pose.
- Pose your skeleton and adjust the blendshapes to what you want.
- Then select any number of SkinnedMeshRender's and click
Tools > GeoTetra > GTAvaUtil > Bake SkinnedMeshRenderer...
.
This will let you transfer the vertex colors from a static mesh onto a SkinnedMeshRenderer. Mainly I use this to transfer baked vertex ambient occlusion onto my avatar.
- Select the MeshFilter you want to transfer colors from.
- Select the SkinnedMeshRenderer you want to transfer the colors to.
- Click
Tools > GeoTetra > GTAvaUtil > Transfer Mesh Colors...
.
Tells you the isReadable state of every mesh in your avatar. If VRC is complaining you have meshes with read/write disabled you can use this to determine which ones.
- Select the root GameObject of your avatar.
- Click
Tools > GeoTetra > GTAvaUtil > IsReadable...
. - Look in console for output.