API reference
API reference
Select your platform
No SDKs available
No versions available

OVRFaceExpressions Class

Extends MonoBehaviour, IReadOnlyCollection< float >, WeightProvider
This class manages the face expressions data provided per frame, and is responsible for stopping and starting face tracking.
Use this class to read face tracking data, accessible via OVRFaceExpressions.this and OVRFaceExpressions.GetWeight to drive the blend shapes on a SkinnedMeshRenderer. For more information, see Face Tracking for Movement SDK for Unity.
Refer to the OVRFaceExpressions.FaceExpression enum for the list of face expressions that contain weights that can be applied to blend shapes.

Member Enumerations

Enumeration FaceRegionConfidence

The face part type used for getting the face tracking confidence weight in TryGetWeightConfidence.
Lower
Represents the lower part of the face.
Upper
Represents the upper part of the face.
Max
Used to determine the size of the FaceRegionConfidence enum.

Enumeration FaceTrackingDataSource

The source type that the face tracking data is currently based off of.
This is part of the data contained in OVRPlugin.FaceState.
Visual
Represents visual based face tracking.
Audio
Represents audio based face tracking.
Count
Used to determine the size of the FaceTrackingDataSource enum.

Enumeration FaceExpression

List of face expressions, based off of the Facial Action Coding System (FACS).
Invalid
= OVRPlugin.FaceExpression2.Invalid
BrowLowererL
= OVRPlugin.FaceExpression2.Brow_Lowerer_L
BrowLowererR
= OVRPlugin.FaceExpression2.Brow_Lowerer_R
CheekPuffL
= OVRPlugin.FaceExpression2.Cheek_Puff_L
CheekPuffR
= OVRPlugin.FaceExpression2.Cheek_Puff_R
CheekRaiserL
= OVRPlugin.FaceExpression2.Cheek_Raiser_L
CheekRaiserR
= OVRPlugin.FaceExpression2.Cheek_Raiser_R
CheekSuckL
= OVRPlugin.FaceExpression2.Cheek_Suck_L
CheekSuckR
= OVRPlugin.FaceExpression2.Cheek_Suck_R
ChinRaiserB
= OVRPlugin.FaceExpression2.Chin_Raiser_B
ChinRaiserT
= OVRPlugin.FaceExpression2.Chin_Raiser_T
DimplerL
= OVRPlugin.FaceExpression2.Dimpler_L
DimplerR
= OVRPlugin.FaceExpression2.Dimpler_R
EyesClosedL
= OVRPlugin.FaceExpression2.Eyes_Closed_L
EyesClosedR
= OVRPlugin.FaceExpression2.Eyes_Closed_R
EyesLookDownL
= OVRPlugin.FaceExpression2.Eyes_Look_Down_L
EyesLookDownR
= OVRPlugin.FaceExpression2.Eyes_Look_Down_R
EyesLookLeftL
= OVRPlugin.FaceExpression2.Eyes_Look_Left_L
EyesLookLeftR
= OVRPlugin.FaceExpression2.Eyes_Look_Left_R
EyesLookRightL
= OVRPlugin.FaceExpression2.Eyes_Look_Right_L
EyesLookRightR
= OVRPlugin.FaceExpression2.Eyes_Look_Right_R
EyesLookUpL
= OVRPlugin.FaceExpression2.Eyes_Look_Up_L
EyesLookUpR
= OVRPlugin.FaceExpression2.Eyes_Look_Up_R
InnerBrowRaiserL
= OVRPlugin.FaceExpression2.Inner_Brow_Raiser_L
InnerBrowRaiserR
= OVRPlugin.FaceExpression2.Inner_Brow_Raiser_R
JawDrop
= OVRPlugin.FaceExpression2.Jaw_Drop
JawSidewaysLeft
= OVRPlugin.FaceExpression2.Jaw_Sideways_Left
JawSidewaysRight
= OVRPlugin.FaceExpression2.Jaw_Sideways_Right
JawThrust
= OVRPlugin.FaceExpression2.Jaw_Thrust
LidTightenerL
= OVRPlugin.FaceExpression2.Lid_Tightener_L
LidTightenerR
= OVRPlugin.FaceExpression2.Lid_Tightener_R
LipCornerDepressorL
= OVRPlugin.FaceExpression2.Lip_Corner_Depressor_L
LipCornerDepressorR
= OVRPlugin.FaceExpression2.Lip_Corner_Depressor_R
LipCornerPullerL
= OVRPlugin.FaceExpression2.Lip_Corner_Puller_L
LipCornerPullerR
= OVRPlugin.FaceExpression2.Lip_Corner_Puller_R
LipFunnelerLB
= OVRPlugin.FaceExpression2.Lip_Funneler_LB
LipFunnelerLT
= OVRPlugin.FaceExpression2.Lip_Funneler_LT
LipFunnelerRB
= OVRPlugin.FaceExpression2.Lip_Funneler_RB
LipFunnelerRT
= OVRPlugin.FaceExpression2.Lip_Funneler_RT
LipPressorL
= OVRPlugin.FaceExpression2.Lip_Pressor_L
LipPressorR
= OVRPlugin.FaceExpression2.Lip_Pressor_R
LipPuckerL
= OVRPlugin.FaceExpression2.Lip_Pucker_L
LipPuckerR
= OVRPlugin.FaceExpression2.Lip_Pucker_R
LipStretcherL
= OVRPlugin.FaceExpression2.Lip_Stretcher_L
LipStretcherR
= OVRPlugin.FaceExpression2.Lip_Stretcher_R
LipSuckLB
= OVRPlugin.FaceExpression2.Lip_Suck_LB
LipSuckLT
= OVRPlugin.FaceExpression2.Lip_Suck_LT
LipSuckRB
= OVRPlugin.FaceExpression2.Lip_Suck_RB
LipSuckRT
= OVRPlugin.FaceExpression2.Lip_Suck_RT
LipTightenerL
= OVRPlugin.FaceExpression2.Lip_Tightener_L
LipTightenerR
= OVRPlugin.FaceExpression2.Lip_Tightener_R
LipsToward
= OVRPlugin.FaceExpression2.Lips_Toward
LowerLipDepressorL
= OVRPlugin.FaceExpression2.Lower_Lip_Depressor_L
LowerLipDepressorR
= OVRPlugin.FaceExpression2.Lower_Lip_Depressor_R
MouthLeft
= OVRPlugin.FaceExpression2.Mouth_Left
MouthRight
= OVRPlugin.FaceExpression2.Mouth_Right
NoseWrinklerL
= OVRPlugin.FaceExpression2.Nose_Wrinkler_L
NoseWrinklerR
= OVRPlugin.FaceExpression2.Nose_Wrinkler_R
OuterBrowRaiserL
= OVRPlugin.FaceExpression2.Outer_Brow_Raiser_L
OuterBrowRaiserR
= OVRPlugin.FaceExpression2.Outer_Brow_Raiser_R
UpperLidRaiserL
= OVRPlugin.FaceExpression2.Upper_Lid_Raiser_L
UpperLidRaiserR
= OVRPlugin.FaceExpression2.Upper_Lid_Raiser_R
UpperLipRaiserL
= OVRPlugin.FaceExpression2.Upper_Lip_Raiser_L
UpperLipRaiserR
= OVRPlugin.FaceExpression2.Upper_Lip_Raiser_R
TongueTipInterdental
= OVRPlugin.FaceExpression2.Tongue_Tip_Interdental
TongueTipAlveolar
= OVRPlugin.FaceExpression2.Tongue_Tip_Alveolar
TongueFrontDorsalPalate
= OVRPlugin.FaceExpression2.Tongue_Front_Dorsal_Palate
TongueMidDorsalPalate
= OVRPlugin.FaceExpression2.Tongue_Mid_Dorsal_Palate
TongueBackDorsalVelar
= OVRPlugin.FaceExpression2.Tongue_Back_Dorsal_Velar
TongueOut
= OVRPlugin.FaceExpression2.Tongue_Out
TongueRetreat
= OVRPlugin.FaceExpression2.Tongue_Retreat
Max
= OVRPlugin.FaceExpression2.Max

Enumeration FaceViseme

List of face visemes.
Invalid
= OVRPlugin.FaceViseme.Invalid
SIL
The viseme representing silence.
PP
The viseme representing p, b, and m.
FF
The viseme representing f and v.
TH
The viseme representing th.
DD
The viseme representing t and d.
KK
The viseme representing k and g.
CH
The viseme representing tS, dZ, and S.
SS
The viseme representing s and z.
NN
The viseme representing n and l.
RR
The viseme representing r.
AA
The viseme representing a:.
E
The viseme representing e.
IH
The viseme representing ih.
OH
The viseme representing oh.
OU
The viseme representing ou.
Count
= OVRPlugin.FaceViseme.Count

Properties

This will be true if face tracking is enabled, otherwise false.
This is returning the current face tracking enabled state from OVRPlugin - to enable/disable face tracking, please refer to OVRPlugin.StartFaceTracking2 and OVRPlugin.StopFaceTracking.
True if the facial expressions returned from the current face tracking data are valid, otherwise false.
This is equivalent to checking if the OVRPlugin.FaceState is valid on this frame.This value gets updated in every frame. You should check this value before querying for face expressions.
True if the eye look-related blend shapes are valid, otherwise false.
This property affects the behavior of two sets of blend shapes.EyesLook:
  • FaceExpression.EyesLookDownL
  • FaceExpression.EyesLookDownR
  • FaceExpression.EyesLookLeftL
  • FaceExpression.EyesLookLeftR
  • FaceExpression.EyesLookRightL
  • FaceExpression.EyesLookRightR
  • FaceExpression.EyesLookUpL
  • FaceExpression.EyesLookUpR
EyesClosed:
  • FaceExpression.EyesClosedL
  • FaceExpression.EyesClosedR
When EyeFollowingBlendshapesValid is false:
  • The EyesLook blend shapes are set to zero.
  • The EyesClosed blend shapes range from 0..1, and represent the true state of the eyelids.
When EyeFollowingBlendshapesValid is true:
  • The EyesLook blend shapes are valid.
  • The EyesClosed blend shapes are modified so that the sum of the EyesClosedX and EyesLookDownX blend shapes range from 0..1. This helps avoid double deformation of the avatar's eye lids when they may be driven by both the EyesClosed and EyesLookDown blend shapes. To recover the true EyesClosed values, add the minimum of EyesLookDownL and EyesLookDownR blend shapes back using the following formula:
    EyesClosedL += min(EyesLookDownL, EyesLookDownR)
    EyesClosedR += min(EyesLookDownL, EyesLookDownR)
True if the visemes are valid, otherwise false.
This value gets updated in every frame. You should check this value before querying for visemes. If you query visemes when it's false, InvalidOperationException will be thrown.
This will return the weight of the specified FaceExpression present in the expression weights array.
Returns
Returns weight of the specified FaceExpression, which will be within the range of 0.0f to 1.0f inclusive.
Exceptions
InvalidOperationException
Thrown when ValidExpressions is false.
ArgumentOutOfRangeException
Thrown when expression value is not in range.
The number of items in this collection (facial expression weights).

Member Functions

Returns the weight of the specified FaceExpression by accessing the expression weights array present through this.
Parameters
expression
The specified FaceExpression to get the weight for.
Returns
The weight of the specified FaceExpression.
This method will try to get the weight of the specified FaceExpression if it's valid.
This can be used if it isn't certain that the specified FaceExpression is a valid expression, or if the facial expressions on this frame are valid.
Parameters
expression
The expression to get the weight of.
weight
The output argument that will contain the expression weight or 0.0 if it's not valid.
Returns
Returns true if the expression weight is valid, false otherwise.
This will return the weight of the given viseme.
Returns
Returns weight of viseme ranged between 0.0 to 1.0.
Exceptions
InvalidOperationException
Thrown when OVRFaceExpressions.AreVisemesValid is false.
ArgumentOutOfRangeException
Thrown when viseme value is not in range.
This method tries to gets the weight of the given viseme if it's available.
Parameters
viseme
The viseme to get the weight of.
weight
The output argument that will contain the viseme weight or 0.0 if it's not available.
Returns
Returns true if the viseme weight is valid, false otherwise.
Copies visemes to a pre-allocated array.
Parameters
array
Pre-allocated destination array for visemes
startIndex
Starting index in the destination array
Exceptions
ArgumentNullException
Thrown when array is null.
ArgumentException
Thrown when there is not enough capacity to copy weights to array at startIndex index.
ArgumentOutOfRangeException
Thrown when startIndex value is out of array bounds.
InvalidOperationException
Thrown when OVRFaceExpressions.AreVisemesValid is false.
This method tries to get the confidence weight of the given face part if it's available.
This can be used if it isn't certain that the facial expressions on this frame are valid.
Parameters
region
The part of the face to get the confidence weight of.
weightConfidence
The output argument that will contain the weight confidence or 0.0 if it's not valid.
Returns
Returns true if the weight confidence is valid, false otherwise.
This method tries to get the data source that was used for the current frame for face tracking data.
This can be used if it isn't certain that the facial expressions on this frame are valid.
Parameters
dataSource
The output argument that will contain the tracking data source.
Returns
Returns true if the face tracking data source is valid, false otherwise.
Copies expression weights to a pre-allocated array.
Parameters
array
Pre-allocated destination array for expression weights
startIndex
Starting index in the destination array
Exceptions
ArgumentNullException
Thrown when array is null.
ArgumentException
Thrown when there is not enough capacity to copy weights to array at startIndex index.
ArgumentOutOfRangeException
Thrown when startIndex value is out of array bounds.
InvalidOperationException
Allocates a float array and copies expression weights to it.
Gets the face expressions enumerator, used for enumerating over OVRFaceExpressions as a collection to read data in this collection of facial expressions by accessing this.
Returns
Did you find this page helpful?
Thumbs up icon
Thumbs down icon