AutoGenerateMapping
(
skinnedMesh
, blendShapeNames
, faceExpressions
, allowDuplicateMapping
)
|
Find the best matching blend shape for each facial expression based on their names.
Use this function to create an association between a SkinnedMeshRenderer's blend shapes and OVRFaceExpressions.FaceExpression values.
This function tokenizes face expression enum strings and blend shape name strings in order to find an array of OVRFaceExpressions.FaceExpression to the blend shapes of a model. It quantifies the quality of the match by the total number of characters in the matching tokens. Furthermore, it requires at least a total of more than 2 characters to match, to avoid matching just single characters. A better technique might be to use Levenshtein distance to match the tokens to allow some typos while still being allowing flexibility with respect to the order of tokens.
Signature
static OVRFaceExpressions.FaceExpression[] AutoGenerateMapping(Mesh skinnedMesh, string[] blendShapeNames, OVRFaceExpressions.FaceExpression[] faceExpressions, bool allowDuplicateMapping) Parameters skinnedMesh: Mesh
The mesh to find a mapping for.
blendShapeNames: string[]
Array of blend shape names.
allowDuplicateMapping: bool
Whether to allow duplicate mapping or not
Returns OVRFaceExpressions.FaceExpression[]
Returns an array of OVRFaceExpressions.FaceExpression of the same length as the number of blend shapes on the skinnedMesh , with each element identifying the closest match found.
|
AutoMapBlendshapes
(
customFace
)
|
The extension method that generates a mapping between the OVRCustomFace blend shapes and the OVRFaceExpressions.FaceExpressions.
Use this function to generate the mapping on the OVRCustomFace in order for face tracking to function properly on the character's skinned mesh renderer. ///
Signature
static void AutoMapBlendshapes(this OVRCustomFace customFace) Parameters Returns void |
ClearBlendshapes
(
customFace
)
|
The extension method that clears the blend shape mappings on a OVRCustomFace instance.
Use this in case the mappings on the instance are not correct. This could happen if the mapping algorithm did not produce a satisfactory result when being driven by face tracking's OVRFaceExpressions.FaceExpression values.
Signature
static void ClearBlendshapes(this OVRCustomFace customFace) Parameters Returns void |