C Specification

The XrFaceExpressionWeights2FB structure is defined as:

// Provided by XR_FB_face_tracking2
typedef struct XrFaceExpressionWeights2FB {
    XrStructureType                type;
    void*                          next;
    uint32_t                       weightCount;
    float*                         weights;
    uint32_t                       confidenceCount;
    float*                         confidences;
    XrBool32                       isValid;
    XrBool32                       isEyeFollowingBlendshapesValid;
    XrFaceTrackingDataSource2FB    dataSource;
    XrTime                         time;
} XrFaceExpressionWeights2FB;

Members

Member Descriptions
  • type is the XrStructureType of this structure.

  • next is NULL or a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension.

  • weightCount is a uint32_t describing the count of elements in weights array.

  • weights is a pointer to an application-allocated array of float that will be filled with weights of facial expression blend shapes.

  • confidenceCount is a uint32_t describing the count of elements in confidences array.

  • confidences is a pointer to an application-allocated array of float that will be filled with confidence of tracking specific parts of a face.

  • isValid is an XrBool32 which indicates that the tracked expression weights are valid.

  • isEyeFollowingBlendshapesValid is an XrBool32 which indicates if the 8 expression weights with prefix XR_FACE_EXPRESSION2_EYES_LOOK_* are valid.

  • dataSource is an XrFaceTrackingDataSource2FB which indicates the data source that was used to estimate the facial expression.

  • time is an XrTime time at which the returned expression weights are tracked or extrapolated to. Equals the time at which the expression weights were requested if the extrapolating at the time was successful.

Description

XrFaceExpressionWeights2FB structure returns the facial expression.

The runtime must return XR_ERROR_VALIDATION_FAILURE if weightCount is not equal to the number of blend shapes defined by the XrFaceExpressionSet2FB used to create the XrFaceTracker2FB.

The runtime must return XR_ERROR_VALIDATION_FAILURE if confidenceCount is not equal to the number of confidence areas defined by the XrFaceExpressionSet2FB used to create the XrFaceTracker2FB.

The runtime must return weights representing the weights of blend shapes of current facial expression.

The runtime must update the weights array ordered so that the application can index elements using the corresponding facial expression enum (e.g. XrFaceExpression2FB) as described by XrFaceExpressionSet2FB when creating the XrFaceTracker2FB. For example, when the XrFaceTracker2FB is created with XR_FACE_EXPRESSION_SET2_DEFAULT_FB, the application sets the weightCount to XR_FACE_EXPRESSION2_COUNT_FB, and the runtime must fill the weights array ordered so that it can be indexed by the XrFaceExpression2FB enum.

The runtime must update the confidences array ordered so that the application can index elements using the corresponding confidence area enum (e.g. XrFaceConfidence2FB) as described by XrFaceExpressionSet2FB when creating the XrFaceTracker2FB. For example, when the XrFaceTracker2FB is created with XR_FACE_EXPRESSION_SET2_DEFAULT_FB, the application sets the confidenceCount to XR_FACE_CONFIDENCE2_COUNT_FB, and the runtime must fill the confidences array ordered so that it can be indexed by the XrFaceConfidence2FB enum.

The runtime must set isValid to XR_FALSE and it must also set all elements of weights to zero, if one of the following is true:

  • the face tracker failed to track or lost track of the face

  • the application lost focus

  • the consent for face tracking was denied

  • the runtime is unable to estimate facial expression from the data sources specified when xrCreateFaceTracker2FB function was called

If the returned isValid is XR_TRUE, the runtime must return all weights (or all weights except eyes related weights, see isEyeFollowingBlendshapesValid).

The runtime must set isEyeFollowingBlendshapesValid to XR_FALSE and it must also set 8 expression weights with prefix XR_FACE_EXPRESSION2_EYES_LOOK_* to zero, if one of the following is true:

  • the eye tracking driving blendshapes with prefix XR_FACE_EXPRESSION2_EYES_LOOK_* lost track

  • the consent for eye tracking was denied

Valid Usage (Implicit)

See Also

Document Notes

For more information, see the OpenXR Specification

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2024, The Khronos Group Inc.