docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RigBuilder

    RigBuilder is the root component that holds the Rigs that create an Animation Rigging hierarchy. Its purpose is to create the PlayableGraph that will be used in the associated Animator component to animate a character with constraints.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    RigBuilder
    Implements
    IAnimationWindowPreview
    IRigEffectorHolder
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Animations.Rigging
    Assembly: Unity.Animation.Rigging.dll
    Syntax
    [RequireComponent(typeof(Animator))]
    [DisallowMultipleComponent]
    [ExecuteInEditMode]
    [AddComponentMenu("Animation Rigging/Setup/Rig Builder")]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.animation.rigging@1.3/manual/RiggingWorkflow.html#rig-builder-component")]
    public class RigBuilder : MonoBehaviour, IAnimationWindowPreview, IRigEffectorHolder

    Fields

    onAddRigBuilder

    Notification callback that is sent whenever a RigBuilder calls OnEnable.

    Declaration
    public static RigBuilder.OnAddRigBuilderCallback onAddRigBuilder
    Field Value
    Type Description
    RigBuilder.OnAddRigBuilderCallback

    onRemoveRigBuilder

    Notification callback that is sent whenever a RigBuilder calls OnDisable.

    Declaration
    public static RigBuilder.OnRemoveRigBuilderCallback onRemoveRigBuilder
    Field Value
    Type Description
    RigBuilder.OnRemoveRigBuilderCallback

    Properties

    effectors

    Declaration
    public IEnumerable<RigEffectorData> effectors { get; }
    Property Value
    Type Description
    IEnumerable<RigEffectorData>

    graph

    Retrieves the PlayableGraph created by this RigBuilder.

    Declaration
    public PlayableGraph graph { get; }
    Property Value
    Type Description
    PlayableGraph

    layers

    Returns a list of RigLayer associated to this RigBuilder.

    Declaration
    public List<RigLayer> layers { get; set; }
    Property Value
    Type Description
    List<RigLayer>

    Methods

    AddEffector(Transform, Style)

    Adds a new effector to the IRigEffectorHolder.

    Declaration
    public void AddEffector(Transform transform, RigEffectorData.Style style)
    Parameters
    Type Name Description
    Transform transform

    The Transform represented by the effector.

    RigEffectorData.Style style

    The visual style of the effector.

    Build()

    Builds the RigBuilder PlayableGraph.

    Declaration
    public bool Build()
    Returns
    Type Description
    bool

    Returns true if the RigBuilder has created a valid PlayableGraph. Returns false otherwise.

    Build(PlayableGraph)

    Builds the RigBuilder playable nodes in an external PlayableGraph.

    Declaration
    public bool Build(PlayableGraph graph)
    Parameters
    Type Name Description
    PlayableGraph graph

    Destination PlayableGraph.

    Returns
    Type Description
    bool

    Returns true if the RigBuilder has created Playable nodes. Returns false otherwise.

    BuildPreviewGraph(PlayableGraph, Playable)

    Appends custom Playable nodes to the animation previewer PlayableGraph.

    Declaration
    public Playable BuildPreviewGraph(PlayableGraph graph, Playable inputPlayable)
    Parameters
    Type Name Description
    PlayableGraph graph

    The animation previewer PlayableGraph

    Playable inputPlayable

    The current root of the PlayableGraph

    Returns
    Type Description
    Playable

    Clear()

    Destroys the RigBuilder PlayableGraph and frees associated RigLayers memory.

    Declaration
    public void Clear()

    ContainsEffector(Transform)

    Queries whether there is an effector for the specified Transform.

    Declaration
    public bool ContainsEffector(Transform transform)
    Parameters
    Type Name Description
    Transform transform

    The Transform to query.

    Returns
    Type Description
    bool

    True if there is an effector for this transform. False otherwise.

    Evaluate(float)

    Updates the RigBuilder layers and evaluates the PlayableGraph manually.

    Declaration
    public void Evaluate(float deltaTime)
    Parameters
    Type Name Description
    float deltaTime

    The time in seconds by which to advance the RigBuilder PlayableGraph.

    Examples

    Manually evaluate the RigBuilder in LateUpdate.

    [RequireComponent(typeof(RigBuilder))]
    public class CustomRigBuilderEvaluator : MonoBehaviour
    {
        private RigBuilder m_RigBuilder;
    
        void OnEnable()
        {
            m_RigBuilder = GetComponent<RigBuilder>();
    
            // Disable the RigBuilder and set its PlayableGraph to manual update mode
            // to let the script evaluate it instead.
            m_RigBuilder.enabled = false;
            if (m_RigBuilder.Build())
            {
                m_RigBuilder.graph.SetTimeUpdateMode(DirectorUpdateMode.Manual);
            }
        }
    
        void LateUpdate()
        {
            m_RigBuilder.Evaluate(Time.deltaTime);
        }
    }

    RemoveEffector(Transform)

    Removes an effector from the IRigEffectorHolder.

    Declaration
    public void RemoveEffector(Transform transform)
    Parameters
    Type Name Description
    Transform transform

    The Transform from which to remove the effector.

    StartPreview()

    Notification callback when the animation previewer starts previewing an AnimationClip.

    Declaration
    public void StartPreview()
    Remarks

    This is called by the Animation Window or the Timeline Editor.

    StopPreview()

    Notification callback when the animation previewer stops previewing an AnimationClip.

    Declaration
    public void StopPreview()
    Remarks

    This is called by the Animation Window or the Timeline Editor.

    SyncLayers()

    Synchronizes rigs and constraints with scene values. This must be called before evaluating the PlayableGraph.

    Declaration
    public void SyncLayers()
    Examples

    Synchronizing layers before evaluating a PlayableGraph created outside the RigBuilder in LateUpdate.

    [RequireComponent(typeof(RigBuilder))]
    public class CustomPlayableGraphEvaluator : MonoBehaviour
    {
        private RigBuilder m_RigBuilder;
        private PlayableGraph m_PlayableGraph;
    
        void OnEnable()
        {
            m_RigBuilder = GetComponent<RigBuilder>();
            m_PlayableGraph = PlayableGraph.Create();
            m_PlayableGraph.SetTimeUpdateMode(DirectorUpdateMode.Manual);
    
            m_RigBuilder.Build(m_PlayableGraph);
        }
    
        void OnDisable()
        {
            if (m_PlayableGraph.IsValid())
                m_PlayableGraph.Destroy();
        }
    
        void LateUpdate()
        {
            m_RigBuilder.SyncLayers();
            m_PlayableGraph.Evaluate(Time.deltaTime);
        }
    }
    See Also
    Build(PlayableGraph)
    SyncSceneToStreamAttribute
    Update(TJob, ref TData)

    UpdatePreviewGraph(PlayableGraph)

    Notification callback when the animation previewer updates its PlayableGraph before sampling an AnimationClip.

    Declaration
    public void UpdatePreviewGraph(PlayableGraph graph)
    Parameters
    Type Name Description
    PlayableGraph graph

    The animation previewer PlayableGraph

    Remarks

    This is called by the Animation Window or the Timeline Editor.

    Implements

    IAnimationWindowPreview
    IRigEffectorHolder
    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)