-
Notifications
You must be signed in to change notification settings - Fork 159
Description
Hi @hecomi!
Thank you for this useful and well made tool. While trying to use it for my application, when I first tested it the result on my avatar was, lets say, "overshooted"! Looking at your uLipSyncBlendShape
code, specifically the OnApplyBlendShapes()
method, I noticed that you compute the final weight value as follows:
weight += bs.weight * bs.maxWeight * volume * 100;
Since maxWeight
, weight
and volume
should be normalized values between 0 and 1, the output weight you are providing is in the form of a percentage (from 0 to 100). At least for the avatar that I'm currently using, taken from ReadyPlayerMe tool, it seems that the blendshape weights for the SkinnedMeshRenderer are meant to be normalized values, between 0 and 1. That is why the first test of the tool applied to my avatar results in a deformed and "broken" mesh.
To fix this, I simply added another serialized bool to your script, called useNormalizedBlendShapeWeights
, and I added a simple line of code in the OnApplyBlendShapes()
, in this way:
weight += bs.weight * bs.maxWeight * volume * 100;
if (useNormalizedBlendShapeWeights) weight /= 100f; // Keep weight normalized between 0 and 1
Please let me know if this fix actually makes sense to you! I hope that this could help improve compatibility with more types of avatars.
Thanks again!