docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRFaceBlendShape

    Represents a blend shape ID and its weight. For more information about blend shapes in Unity, refer to the tutorial Setting up Blendshapes in Unity.

    Implements
    IEquatable<XRFaceBlendShape>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public struct XRFaceBlendShape : IEquatable<XRFaceBlendShape>

    Constructors

    XRFaceBlendShape(int, float)

    Constructs an instance with the given blend shape identifier and weight.

    Declaration
    public XRFaceBlendShape(int blendShapeId, float weight)
    Parameters
    Type Name Description
    int blendShapeId

    The blend shape ID.

    float weight

    The weight, between 0.0 and 1.0.

    Properties

    blendShapeId

    The ID of the blend shape, as defined by the platform. Refer to Face tracking platform support to learn if your target platform supports blend shapes, and if so, refer the provider plug-in manual for that platform to understand the meaning of each ID value.

    Declaration
    public int blendShapeId { get; }
    Property Value
    Type Description
    int

    weight

    A value from 0.0 (no influence) to 1.0 (maximum influence) that specifies the influence of this blend shape in the facial expression. The value may describe, for example, how closed is the left eye, how open is the mouth, etc.

    Declaration
    public float weight { get; }
    Property Value
    Type Description
    float

    Methods

    Equals(object)

    Tests for equality, using float.Equals when comparing weights.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare against.

    Returns
    Type Description
    bool

    true if this face blend shape is equal to obj using Equals(XRFaceBlendShape). Otherwise, returns false.

    Overrides
    ValueType.Equals(object)

    Equals(XRFaceBlendShape)

    Tests for equality, using float.Equals when comparing weights.

    Declaration
    public bool Equals(XRFaceBlendShape other)
    Parameters
    Type Name Description
    XRFaceBlendShape other

    The other face blend shape to compare against.

    Returns
    Type Description
    bool

    true if this face blend shape has the same ID and weight as other. Otherwise, returns false.

    GetHashCode()

    Generates a hash suitable for use with containers like HashSet and Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    This face blend shape's hash code.

    Overrides
    ValueType.GetHashCode()

    Operators

    operator ==(XRFaceBlendShape, XRFaceBlendShape)

    Tests for equality. Equivalent to Equals(XRFaceBlendShape).

    Declaration
    public static bool operator ==(XRFaceBlendShape lhs, XRFaceBlendShape rhs)
    Parameters
    Type Name Description
    XRFaceBlendShape lhs

    The instance to compare with rhs.

    XRFaceBlendShape rhs

    The instance to compare with lhs.

    Returns
    Type Description
    bool

    true if lhs is equal to rhs using Equals(XRFaceBlendShape). Otherwise, returns false.

    operator !=(XRFaceBlendShape, XRFaceBlendShape)

    Tests for inequality. Equivalent to the negation of Equals(XRFaceBlendShape).

    Declaration
    public static bool operator !=(XRFaceBlendShape lhs, XRFaceBlendShape rhs)
    Parameters
    Type Name Description
    XRFaceBlendShape lhs

    The instance to compare with rhs.

    XRFaceBlendShape rhs

    The instance to compare with lhs.

    Returns
    Type Description
    bool

    false if lhs is equal to rhs using Equals(XRFaceBlendShape). Otherwise, returns true.

    Implements

    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)