Skip to content
rurre edited this page Nov 26, 2018 · 13 revisions

Pumkin's Avatar Tools Documentation

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

Installation:

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.

Usage:

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.

There are 3 main sections to this tool:

Tools

This menu allows you to perform actions on your Selected Avatar.

  • Fill Visemes - This will automatically select the Face Mesh and set Viseme 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 your Avatar 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 the Accept and Cancel buttons. Move the Viewpoint position to where you want your eyes in VRChat to be, and click Apply to apply the changes. While the viewpoint position gets updated on the avatar descriptor in real time, clicking Cancel 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 clicking Edit Viewpoint and your Avatar Rig is set to Humanoid, 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 the Humanoid rig menu.
  • Reset Pose - This will reset all the Transform components of your Avatar to the values set in it's prefab.
  • 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.

Copy Components

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.
  1. Position - Copies the local position of all the transforms in the avatar, except the root avatar object.
  2. Rotation - Copies the local rotation, and the local euler angles of all the transforms in the avatar, except the root avatar object.
  3. 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 their Root. 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.
  1. Copy Settings - This will allow DynamicBone component settings to be copied 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 the Copy from avatar.
  2. Copy Colliders - This will allow DynamicBonesCollider components to be copied 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 the Remove Old Colliders option to remove all the DynamicBoneCollider components from your avatar prior to copying the new ones over.
  3. Create Missing Bones - This will allow new DynamicBone components to be created if they're missing on the object being copied to but not on the one being copied from.
  4. 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 the Remove All section buttons in the Tools menu instead.
  5. 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 the Remove All section buttons in the Tools 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 and Pipeline Manager components and settings. If the components are missing they will be created automatically.
  1. 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.
  2. Pipeline Id - This will copy over the Pipeline Id of your avatar into the Pipeline Manager component.
  3. 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.
  1. Settings - This will copy over: Quality, Update when Offscreen, Skinned Motion Vectors and Lighting Settings. Additionally the Root bone and Anchor Override transforms will be copied over and refernces changed to match the selected avatar. Bounds will also be recalculated.
  2. 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.
  3. 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.
  1. Box Colliders - This option will allow Box Colliders to be copied over.
  2. Capsule Colliders - This option will allow Capsule Colliders to be copied over.
  3. Sphere Colliders - This option will allow Sphere Colliders to be copied over.
  4. Mesh Colliders - This option will allow Mesh Colliders to be copied over.
  5. 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 the Tools menu instead.

Avatar Info

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:

  1. Avatar Name - The name of your avatar object. Probably..
  2. Skinned Mesh Renderers - The number of SkinnedMeshRenderer components on your Avatar.
  3. Mesh Renderers - The number of Mesh Renderer components with associated Mesh Filter components that have their mesh set on your Avatar and all of it's children.
  4. Triangles - The number of Triangles of all the meshes associated with your avatar.
  5. Used Material Slots - The number of Material Slots with their materials set, on all the SkinnedMeshRenderer and MeshRenderer components on your Avatar and all of it's children.
  6. Unique Materials - The number of Unique Materials in use between all the renderers on your Avatar and all of it's children.
  7. Shaders - The number of Unique Shaders in use between all the Materials that are in use on all the renderers on your Avatar and all of it's children.
  8. Dynamic Bone Transforms - The number of DynamicBone Transforms on your Avatar. This counts all the Transforms from the Root to all of it's children, minus the Excluded Transforms and all of their children.
  9. Dynamic Bone Colliders - This counts the number of DynamicBoneCollider components on your Avatar and all of it's children.
  10. Collider Affected Transforms - This counts the number of DynamicBone Transforms that have DynamicBoneColliders associated with them, and that can interact.
  11. Particle Systems - This counts the number of Particle Systems on your Avatar and all of it's children.
  12. Max Particles - This counts the Max Particle values from all the Particle Systems on your Avatar and all of it's children.

Misc

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 allow DynamicBones 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 of PumkinsAvatarTools.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 #defines 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.

Clone this wiki locally