Blend Shape Clamper v1.0.* Instructions
Overview
This is a NDMF plugin that non-destructively clamps blendshapes.
This plugin recalculates blendshape deformation so that a value of 100 produces the same result as the original specified percentage.
Generally used to prevent clipping caused by other shape keys after adjusting facial shape keys.
Features
- Non-destructively clamp blend shapes with a component.
- Preview blend shapes when configuring.
- Also handle blend shape values in animation clips.
Notes
- This package has only been tested with VRCSDK3 and Unity 2022.3.22f1.
Installation
Dependencies
This package depends on the following packages. Make sure you have installed it before installing this package.
- Non-Destructive Modular Framework (1.9.4 or higher): https://github.com/bdunderscore/ndmf
Installing Package
- Go to our vpm package listing page.
- Click on
Add to VCCbutton to add the repository into VCC/ALCOM. - In VCC/ALCOM, go to the project's manage page and install
Blend Shape Clamper.
How to Use
Adding Component
- Select the skinned mesh renderer with blend shapes about to clamp in your avatar.
- Click on
Add Componentin inspector. - Search for
Blend Shape Clamperand add it to game object.
Configuring Blend Shape Clamps
After adding the clamper component:
- Click on the
+icon at the bottom right of theBlendshapes to clamplist to add a new clamp item. - Click on the selector in the left of the clamp item, and select the blend shape to clamp.
- Adjust the slider in the right of the clamp item, to configure the clamp value, and to preview the clamp result.
- Click on the
Stop Previewingbutton or select other game object to stop previewing.
Done
Enter play mode or build the avatar to see the result.
How to Use endHow Does It Work
This plugin runs in NDMF's optimizing phase.
What Does It Do
When it runs, It does:
- Searchs for every clamper component in avatar.
- Clamps blendshapes and handle their values in skinned mesh renderers in the same game object with clamper components.
- Handles animations which contains animation curves controlling clamped blend shapes.
Value Overwrite Rules
The values of clamped blend shapes (Both in skinned mesh renderers and animations) will be overwritten by the following rules:
-
When the original value is equal with or larger than the clamped value, overwrite it to 100. Example:
Original value: 80
Clamped to: 70
Result: 100 -
When the original value is smaller than the clamped value, overwrite it to (original value / clamped value *100) Example:
Original value: 50
Clamped to: 70
Result: 50 / 70 * 100 ≈ 71.4286