[Feature] Run build wrinkle map for blend shape index
liudger opened this issue · 2 comments
liudger commented
When combining meshes for better performance the index of the blendshapes changes as there are more blenshapes for some meshed. (eyebrows) It would be nice to have a button to set the index of the wrinkle manager again based on the current blend shapes.
Using Unity Meshbaker https://digitalopus.ca/site/mesh-baker/
liudger commented
Code is already there. Just need a button!
private void UpdateBlendShapeIndices()
{
if (skinnedMeshRenderer && headMaterial)
{
Mesh mesh = skinnedMeshRenderer.sharedMesh;
foreach (WrinkleConfig wc in config)
{
wc.blendShapeIndex = mesh.GetBlendShapeIndex(wc.blendShapeName);
wc.enabled = wc.blendShapeIndex >= 0;
foreach (WrinkleRuleSet wm in wc.ruleSets)
{
if (wrinkleRules.TryGetValue(wm.ruleName, out WrinkleRule rule))
{
wm.enabled = true;
}
else
{
wm.enabled = false;
}
}
}
}
}