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.
Inherited Members
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.1/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. |
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. |
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.
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.