-
Notifications
You must be signed in to change notification settings - Fork 49
Home
Pumkin's Avatar Tools is a Unity editor script that provides a set of tools to automate and simplify certain avatar setup tasks within Unity. This Wiki goes over all the functionality of the tool, in detail.
How the tool looks like: Here
(Very) Outdated Video Example: Here
Grab the latest Unity Package from the releases page and run it.
You will be prompted to import 2 files. PumkinsAvatarTools.cs
and _DependencyChecker.cs
.
By default these files will be imported into Scripts > Editor > Pumkin
.
Both of these files need to go into a folder called Editor
anywhere in your project. Note that you can have multiple Editor
folders across your project.
To bring up the Tools window go to the top Menu Bar and select Tools > Pumkin > Avatar Tools
.
In order to use any of the tools an Avatar has to be selected first.
To select an avatar either drag it into the Selected Avatar
object field, or select the avatar in your Unity scene and click the Select from Scene
button.
When using the Select from Scene
button, any child of the Avatar can be selected and the tool will automatically pick the root object and slot it into the Selected Avatar field, in this case our Avatar.
This menu allows you to perform actions on your Selected Avatar.
-
Fill Visemes - This will automatically select the
Face Mesh
and setViseme Blendshape
as your lipsync method, as well as fill in the Viseme fields with the ones VRChat expects, if they are present on your mesh. If not,Default
will be selected instead as your lipsync method. These settings get applied to yourAvatar Descriptor
. If it is missing it will be added automatically. - Reset Blendshapes - This will reset the value of all the Blendshapes on all the SkinnedMeshRenderer components on your Avatar and it's children to 0. Useful for when you want to reset the default facial expression of your Avatar.
-
Edit Viewpoint - This will allow you to move around the Viewpoint position of your avatar as if it was an object in the hierachy. When clicking
Edit Viewpoint
your Avatar's Viewposition ball with turn into an object you can move around, and a small window overlay will be added to your Scene View with theAccept
andCancel
buttons. Move the Viewpoint position to where you want your eyes in VRChat to be, and clickApply
to apply the changes. While the viewpoint position gets updated on the avatar descriptor in real time, clickingCancel
will revert the position to where it was before starting the edit. If the Viewpoint Position is at the default value of (0, 1.6, 0.2) when clickingEdit Viewpoint
and yourAvatar Rig
is set toHumanoid
, the Viewpoint will be centered in front of the origin of your Head Bone at the height of your Avatar's left eye, as selected in theHumanoid
rig menu. -
Reset Pose - This will
reset all
theTransform
components of your Avatar to the values set in it'sprefab
. -
Remove All - This will
remove all
the components of type indicated on the button from your Avatar and all of it's children.
Note: If Dynamic Bones
and Dynamic Bone Colliders
are greyed out it means Dynamic Bones weren't detected in your project.
This menu allows you to copy components from one avatar to another. To use this an Avatar needs to be selected and put into the Copy from
object field. The Select from Scene
button under the Copy from
can be used to fill the slot in the same manner as the button to Select an Avatar at the top of the window.
After that individual components can be selected to be copied with the Copy Selected
button.
Tick the box to the left of the component you want to select then expand the component by clicking the arrow to the left of it to reveal additional options.
- Transforms - This allows you to copy the 'pose' from one Avatar to another. Values are copied by the name of the transform under the same parent, so the order of objects doesn't matter as long as the name of transform being copied to is the same as the one copied from and their parents have the same names.
- Position - Copies the local position of all the transforms in the avatar, except the root avatar object.
- Rotation - Copies the local rotation, and the local euler angles of all the transforms in the avatar, except the root avatar object.
- Scale - Copies the local scale of all the transforms in the avatar, except the root avatar object.
-
Dynamic Bones - This allows you to copy over
Dynamic Bones
from one avatar to another. Components are copied by child name, similar to how Transforms are copied. As long as a child with the same name exists on both avatars and is on a parent with the same name, it will be transferred over.Dynamic Bones
get copied over based on theirRoot
. If multiple scripts affect the same Root transform only one will be copied over, and if a script doesn't have it's Root set it will be ignored. If a DynamicBones component with the same root already exists on the object being copied to a duplicate will not be created and instead it's settings updated.
-
Copy Settings - This will allow
DynamicBone
component settings to becopied over
. With this ticked if a DynamicBone component is found on an object with the same root, it's settings will be updated with new ones from theCopy from
avatar. -
Copy Colliders - This will allow
DynamicBonesCollider
components to becopied over
. If a collider with the exact same settings already exists on the object, a new one will not be created. If any of the settings is different, a new one will be created. If this behaviour isn't desirable consider checking theRemove Old Colliders
option to remove all the DynamicBoneCollider components from your avatar prior to copying the new ones over. -
Create Missing Bones - This will allow new
DynamicBone
components to becreated
if they're missing on the object being copied to but not on the one being copied from. -
Remove Old Bones - This will remove all
DynamicBone
components prior to copying anything. This setting can be used alone without any others ticked to just remove all DynamicBone components, but in this case consider using theRemove All
section buttons in theTools menu
instead. -
Remove Old Colliders - This will remove all
DynamicBoneCollider
components from the avatar prior to copying anything. This setting can be used alone without any others ticked to just remove all DynamicBoneCollider components, but in this case consider using theRemove All
section buttons in theTools menu
instead.
Note: If DynamicBones
could not detected in your project the whole DynamicBones
menu will greyed out and disabled. In this case the name of the menu will be appended with (Not Found)
. Check the Misc
section for tips on how to fix this.
-
Avatar Descriptor - This will let you copy over the
Avatar Descriptor
andPipeline Manager
components and settings. If the components are missing they will be created automatically.
- Settings - This will copy over the settings of your avatar descriptor including: the View Position, Lipsync setup, Default Animtion Set (Male/Female), and the Scale IPD setting.
- Pipeline Id - This will copy over the Pipeline Id of your avatar into the Pipeline Manager component.
- Animation Overrides - This will copy over the Animation Override controllers that are used for overriding gestures.
- Skinned Mesh Renderers - This will allow you to copy over Skinned Mesh Renderer setups.
-
Settings - This will copy over: Quality, Update when Offscreen, Skinned Motion Vectors and Lighting Settings. Additionally the
Root bone
andAnchor Override
transforms will be copied over and refernces changed to match the selected avatar. Bounds will also be recalculated. -
Materials - This will copy over the
material slots
from one avatar to another. Useful when materials slots are empty or not filled correctly, but the expected materials and slots should be the same on both avatars. - BlendShape Values - This will copy over the BlendShape values from one avatar to another. This is commonly used for setting default facial expressions.
-
Colliders - This allows you to copy over
Colliders
from one avatar to another. Note that if a Collider with the same values already exists on the Avatar a duplicate will not be created. If any one setting in the inspector is different a new collider will be instead created. If this isn't the desired behaviour consider ticking 'Remove Old Colliders' before copying.
-
Box Colliders - This option will allow
Box Colliders
to be copied over. -
Capsule Colliders - This option will allow
Capsule Colliders
to be copied over. -
Sphere Colliders - This option will allow
Sphere Colliders
to be copied over. -
Mesh Colliders - This option will allow
Mesh Colliders
to be copied over. -
Remove Old Colliders - This will remove all Colliders for the selected Avatar and all of it's children. This setting can be used alone without any others ticked to just remove all Collider components, but in this case consider using the
Remove All
section buttons in theTools menu
instead.
This section displays a few quick stats of your avatar. Each element displays 2 values, one for enabled objects and one for total objects, shown in brackets. When an Action from the Tools Menu
or a Copy Components
operation is preformed the stats should be automaticaly refreshed, but in case they aren't, the Refresh
button can be used to generate the info again.
Currently Displayed:
- Avatar Name - The name of your avatar object. Probably..
-
Skinned Mesh Renderers - The number of
SkinnedMeshRenderer
components on your Avatar. -
Mesh Renderers - The number of
Mesh Renderer
components with associatedMesh Filter
components that have their mesh set on your Avatar and all of it's children. -
Triangles - The number of
Triangles
of all the meshes associated with your avatar. -
Used Material Slots - The number of
Material Slots
with their materials set, on all theSkinnedMeshRenderer
andMeshRenderer
components on your Avatar and all of it's children. -
Unique Materials - The number of
Unique Materials
in use betweenall the renderers
on your Avatar andall of it's children
. -
Shaders - The number of
Unique Shaders
in use between all theMaterials
that are in use onall the renderers
on your Avatar andall of it's children
. -
Dynamic Bone Transforms - The number of
DynamicBone Transforms
on your Avatar. This countsall the Transforms
from theRoot
to all of it's children, minus theExcluded Transforms
andall of their children
. -
Dynamic Bone Colliders - This counts the number of
DynamicBoneCollider
components on your Avatar andall of it's children
. -
Collider Affected Transforms - This counts the number of
DynamicBone Transforms
that haveDynamicBoneColliders
associated with them, and that can interact. -
Particle Systems - This counts the number of
Particle Systems
on your Avatar and all of it's children. -
Max Particles - This counts the
Max Particle
values from all theParticle Systems
on your Avatar andall of it's children
.
This section currently only appears
if your project is missing DynamicBones
. To fix this add the latest version of DynamicBones
to your project. Importing them should cause the _DependecyChecker
(Yes, I know it's misspelled) to check for DynamicBones
again and a few things happen:
- If they're not found,
PumkinsAvatarTools.cs
is appended with#define NO_BONES
which will allowDynamicBones
to be completely ignored. - If they're found,
DynamicBoneCollider.cs
is checked in case it's an old version and if it is, the top ofPumkinsAvatarTools.cs
is appended with#define OLD_BONES
which will allow the script to work with the old version. *If they're found and aren't an old version, either#define
s are stripped from the main script file and full functionality is restored.
Whenever scripts are recompiled the DynamicBones check is automatically performed, but it can also be triggered by clicking the Search for Dynamic Bones
button. Once they're detected, the menu disappears.