babylon-vrm-loader
babylon-vrm-loader copied to clipboard
Why the morphTarget is an array ?
I want to replace three-vrm with babylon-vrm-loader, but I have confusion about the morph target: In three-vrm, change blendeshape using as following (demo):
// set value
currentVrm.blendShapeProxy.setValue( THREE.VRMSchema.BlendShapePresetName.A, 0.5 + 0.5 * s );
currentVrm.blendShapeProxy.setValue( THREE.VRMSchema.BlendShapePresetName.BlinkL, 0.5 - 0.5 * s );
// get value
currentVrm.blendShapeProxy.getValue( THREE.VRMSchema.BlendShapePresetName.A);
currentVrm.blendShapeProxy.getValue( THREE.VRMSchema.BlendShapePresetName.BlinkL);
In babylon-vrm-loader, I think using morphing method can set value.
currentVrm.morphing('A', 1)
currentVrm.morphing('Blink_L', 1)
However, I don't know how to get the morphTarget value because the target is an array. And the array has the same object as this:
three-vrm get value method source code
There are MorphTarget
s per Mesh.morphTargetManager
, so we need to set influence every related meshes.
Currently, there is no API to retrieve runtime morphTarget value.
I think it is good to add API like VRMManager.getMorphing(label: string): Nullable<number>
.
@il-m-yamagishi Thanks for your reply! But how to calculate the result of influence value? Just compare the counts of value 1 and value 0, or if has 0 then return 0, or other rules? I'm not familiar with the VRM.