Class FaceMapper
An asset used to apply a face pose to a character rig.
Namespace: Unity.LiveCapture.ARKitFaceCapture
Syntax
public abstract class FaceMapper : ScriptableObject
Remarks
To use a mapper, it must be assigned to a FaceActor component. Unity.LiveCapture.ARKitFaceCapture.DefaultMapper.DefaultFaceMapper is the default mapper implementation, designed to work for rigs that can have their bone transforms and renderer blend shapes modified directly. For complex rigs that need more advanced re-targeting of the captured face animation, inherit from this class to implement custom mapper.
Methods
ApplyBlendShapesToRig(FaceActor, FaceMapperCache, ref FaceBlendShapePose, Boolean)
Called by FaceActor to update a face rig to show a face pose.
Declaration
public abstract void ApplyBlendShapesToRig(FaceActor actor, FaceMapperCache cache, ref FaceBlendShapePose pose, bool continuous)
Parameters
Type | Name | Description |
---|---|---|
FaceActor | actor | The face rig the pose is applied to. |
FaceMapperCache | cache | The mapper state cache for the given actor. |
FaceBlendShapePose | pose | The face pose to map from. |
Boolean | continuous | When true, the new pose follows the current pose and they can be smoothed between, while false corresponds to a seek in the animation where the previous pose is invalidated and should not influence the new pose. |
ApplyEyeRotationToRig(FaceActor, FaceMapperCache, ref FaceBlendShapePose, ref Quaternion, ref Quaternion, Boolean)
Called by FaceActor to update the eye rotations of the face rig.
Declaration
public abstract void ApplyEyeRotationToRig(FaceActor actor, FaceMapperCache cache, ref FaceBlendShapePose pose, ref Quaternion leftEyeRotation, ref Quaternion rightEyeRotation, bool continuous)
Parameters
Type | Name | Description |
---|---|---|
FaceActor | actor | The face rig the pose is applied to. |
FaceMapperCache | cache | The mapper state cache for the given actor. |
FaceBlendShapePose | pose | The face blend shapes to map from. |
Quaternion | leftEyeRotation | The left eye rotation to map from. |
Quaternion | rightEyeRotation | The right eye rotation to map from. |
Boolean | continuous | When true, the new pose follows the current pose and they can be smoothed between, while false corresponds to a seek in the animation where the previous pose is invalidated and should not influence the new pose. |
ApplyHeadPositionToRig(FaceActor, FaceMapperCache, ref Vector3, Boolean)
Called by FaceActor to update the head position of the character rig.
Declaration
public abstract void ApplyHeadPositionToRig(FaceActor actor, FaceMapperCache cache, ref Vector3 headPosition, bool continuous)
Parameters
Type | Name | Description |
---|---|---|
FaceActor | actor | The face rig the pose is applied to. |
FaceMapperCache | cache | The mapper state cache for the given actor. |
Vector3 | headPosition | The head position to map from. |
Boolean | continuous | When true, the new pose follows the current pose and they can be smoothed between, while false corresponds to a seek in the animation where the previous pose is invalidated and should not influence the new pose. |
ApplyHeadRotationToRig(FaceActor, FaceMapperCache, ref Quaternion, Boolean)
Called by FaceActor to update the head rotation of the character rig.
Declaration
public abstract void ApplyHeadRotationToRig(FaceActor actor, FaceMapperCache cache, ref Quaternion headOrientation, bool continuous)
Parameters
Type | Name | Description |
---|---|---|
FaceActor | actor | The face rig the pose is applied to. |
FaceMapperCache | cache | The mapper state cache for the given actor. |
Quaternion | headOrientation | The head pose to map from. |
Boolean | continuous | When true, the new pose follows the current pose and they can be smoothed between, while false corresponds to a seek in the animation where the previous pose is invalidated and should not influence the new pose. |
CreateCache(FaceActor)
Creates a mapper state cache for the given actor.
Declaration
public virtual FaceMapperCache CreateCache(FaceActor actor)
Parameters
Type | Name | Description |
---|---|---|
FaceActor | actor | The face rig to create the cache for. |
Returns
Type | Description |
---|---|
FaceMapperCache | The new cache instance, or null if no cache is needed by the mapper. |