Control Rig allows you to create custom controls on your imported skeletal mesh in which you can generate new, or modify existing animations within the Unreal Editor. This document provides an overview of the Control Rig editor and how to create animations with your rig.
Prerequisites
You must enable the Control Rig plugin. To do this, navigate in the Unreal Editor menu bar to Edit > Plugins and search for Control Rig. Ensure the plugin is enabled and restart the editor.
You have imported a Skeletal Mesh asset into your project.
You have some experience using the Unreal Sequencer tool.
Create a Control Rig Asset
You can choose to create a control rig for a skeletal mesh in a couple of different ways.
In the first method you can right-click on your Skeletal Mesh Asset and select Create Control Rig. This creates a new Control Rig asset with your skeletal mesh already assigned. The asset will automatically name itself after the Skeletal Mesh and apply the suffix _CtrlRig.
The second method is to create a Control Rig manually. You can do this by right-clicking in the content browser and select Animation > Control Rig. In the context menu, select ControlRig and click Create.
After the asset is created, double-click it in the Content Browser to open it.
The Control Rig Editor
Once you've opened the Control Rig asset, you will see the Control Rig editor. The following is an overview of its main areas.
Toolbar
The Control Rig Toolbar contains buttons and settings used to control the preview behavior and control rig construction. The buttons with specific Control Rig functionality are as follows:
Compile
You are required to Compile whenever changes are made to the Rig Hierarchy. This can include adding, removing, reparenting, renaming controls, bones or spaces. You also need to recompile when you create variables.
The Compile button can also be used as a way to reset your controls.
Event Mode
The Event Mode tool is used to switch between different graph event chains. Each option is associated with a Rig Graph event node.
Setup Event will fire the Setup Event node chain, as well as activating the Setup mode which enables you to manipulate the initial positions of Bones, Controls and Spaces.
Forwards Solve will trigger the Forwards Solve node chain. Moving controls in this mode affects their current position only and is temporary.
Backwards Solve will fire the Backwards Solve node chain. You can use this mode to have the bones drive the controls, instead of the other way around, in order to allow for the Bake to Control Rig functionality in Sequencer.
Backwards and Forwards will fire first the Backwards Solve chain, then the Forwards Solve chain. Typically you would use this if you want to validate both chains are working together well sequentially.
Auto Compile
Enable this to set compiling to automatically occur when you make changes in the Rig Graph. All other changes mentioned above will still require you to manually Compile.
Debug Object
This drop-down menu allows you to link the Control Rig viewport to an active game session's character. This enables you to preview the current animation from that session in the Control Rig viewport.
Class Settings
Most of the items here are ordinary Blueprint properties. Class Settings within Control Rig Blueprints contain the Gizmo Library, which you can use to edit the various Gizmos that controls use to define their shapes.
Viewport
The viewport is where you can interact with your control rig nodes, as well as set different preview modes and display settings.
Control Rig options are located within the View Options panel. Display Spaces enables/disables the drawing of the local axis for any Space objects in the scene. Display Axes on Selection will only draw the local axis if the Space is selected, and Axes Scale will scale the axis being drawn.
Rig Hierarchy
The Rig Hierarchy panel is used to view your current Skeleton and Control hierarchy in an outliner-type view. This is also the primary area to create new Bones, Controls and Spaces.
Create these elements by right-clicking in the panel and selecting New > Bone, Control, or Space. This will create a new control at 0,0,0.
Other context menu commands are:
Reset Transform / All Transforms
This command resets your currently selected node, or all nodes back to their initial transform.
Set Initial Transform from Current
Use this command to set the Initial Transform to the current location of your node. Resetting the transform will now reset it to this new location.
Set Initial Transform from Closest Bone
Using this command will snap your selected Control to the nearest bone and set that location as the Initial Transform. Useful for aligning your controls to bones.
Set Gizmo Transform from Current
If you are transforming your gizmo, performing this command will reset the Gizmo's pivot point back to its initial transform, but maintain the current visual position of the Gizmo. Useful if you want to customize your gizmo's visual position while keeping the pivot point the same.
Unparent
Unparent will remove the currently selected node and place it at the top of the hierarchy.
Execution Stack
The Execution Stack panel allows you to preview the order of operations within your graph. This can be used to debug your nodes and evaluate the sequence of events.
Right-clicking on an execution node and selecting Focus on Selection will frame that current node in the Rig Graph.
Rig Graph
The Rig Graph is where you will primarily script the Control Rig's behavior.
Hierarchy nodes can be referenced into the graph by dragging and dropping them from the Hierarchy panel into the graph and selecting your desired reference type.
Nodes can also be created by right-clicking. Search or navigate the context menu for your desired node. Any node with an execution event will automatically hook itself into the previous node's execution event for convenience.
Details / Preview Scene
The Details panel contains the information for your selected elements within the Control Rig Editor. These can include elements such as controls, bones, and graph nodes.
The Preview Scene panel contains visual information for your viewport scene. You can change the skeletal mesh preview, adjust lighting, and other various visual settings here.
My Blueprint
The My Blueprint panel, similar to that found in normal Blueprints, houses your various Functions and Variables.
Functions and Variables are added by clicking the Add buttons either in the top left of the panel, or on the respective headers.
Variables in Control Rig are meant to be used within your Rig Graph as a way to drive logic, rather than being exposed directly to an instance in a level.
Create a Basic FK Control Rig
This section will cover how you can create a simple FK (Forward Kinematic) Control Rig. This example will use a relatively simple robotic arm with 5 main bones.
Start by creating the Control Rig Asset for your desired Skeletal Mesh. Right-click on the asset in the Content Browser and select Create Control Rig. Once this is done, open the asset.
Create Controls
Now, create your first control, which likely will be the Root. Right-click in the Rig Hierarchy and select New > New Control. Controls created in this manner will be created at the 0,0,0 coordinates of the scene. You may want to rename this control after creation.
It is possible your control is not visible in the viewport, as is the case with this example. To change the Gizmo shape and color, select the control and navigate in the Details panel to the Gizmo category. The properties here will allow you to customize the control's shape, size, and color.
Now go ahead and create controls for the rest of the bones. One way to do this effectively is to right-click on your desired bones and select New > New Control. This way your controls will be created at the same transform as the selected bones, allowing for easier alignment.
Parenting and Hierarchy
Once you've adjusted your Controls shapes and names, you should also unparent them from the Skeletal Hierarchy, and make your own hierarchy of controls separate from the bones. Do this by right-clicking on the control and select Unparent. Once all controls are unparented, make sure you delete the Space nodes, as they are no longer needed.
Now you can re-create the Hierarchy on your controls. To do this, drag and drop a control in the Rig Hierarchy view to parent it to the target control. Do this for all controls.
Rig Logic
With your Rig Hierarchy ready, you can now start binding your controls to affect the bones.
Start by dragging the Root bone from the Hierarchy panel to the Rig Graph and select Set Transform, which will create a Set Transform node targeting that bone. Then drag and drop the corresponding control into the graph and select Get Control. Finally, connect the Transform pins from the Get Transform - Control node to the Set Transform - Bone node.
Feel free to move your control to preview how it affects the bone. Enabling Propagate to Children on the Set Transform node will allow you to see the change propagate down the entire hierarchy from that bone.
Now go ahead and create a similar logic chain for the rest of your bones and controls. Connect each Control's Get Transform node to a corresponding Set Transform node on the Bone.
Once completed, all your controls should manipulate their respective bones. Remember that you can use the Compile button as a quick way to reset your controls back to their initial transform.
Create a Basic IK Control Rig
This section will cover how you can create a simple IK (Inverse Kinematic) Control Rig. This example will use a relatively simple robotic arm with 5 main bones. It will also assume you have a Control Rig Asset already created with a Root control, as was covered earlier in this document.
Create Controls
Start by creating the end effector Control. Since this is only a relatively simple example, you only need to create a single IK effector control.
Right click on the desired bone (hand) and press CTRL+N to quickly create a new control on the selected bone. Then unparent it from that control by right clicking it and selecting Unparent. Delete the corresponding Space element as it is not necessary.
Feel free to also name your control and set your desired color, size, and shape in the Details panel.
Rig Logic
In the Rig Graph, right-click and browse to Hierarchy > CCDIK. Select it to create this node. The CCDIK node is a type of IK node that will allow you to connect your various bones and effectors.
Next, create an Item Chain node. Do this by right clicking in the graph and selecting Collections > Item Chain. The Item Chain node is used to define your start and end bones in the IK Chain. Once defined, they will include all other bones in between them to form the entire chain collection.
In the First Item category, set the Name to your desired start bone. Do the same for Last Item Name as well.
Finally, drag and drop your Effector Control from the Rig Hierarchy to the Graph and select Get Control. Hook up the Transform pin from the Get Transform - Control node to the CCDIK Effector Transform pin. Then hook up the Collection pin from I**tem Chain to the CCDIK Items** pin.
Your IK Chain should now work. Move the Control in the viewport to see your results. You may also want to enable the Propagate to Children bool on the CCDIK node to allow the child bones to follow along.
Animating in Sequencer
Once you have a completed Control Rig, you can animate it in Sequencer.
An easy way to do this is by dragging the Control Rig Asset from the Content Browser into your level. This will automatically create and open a new Sequencer Asset so you can start animating.
To set keyframes on your controls, press either Enter (to key all), or the S key (to key transform only) with the control selected.
Your controls are located as child tracks under the primary Control Rig track. You can either view all keys set on all controls, or expand further to see individual controls with their associated keyframes.
Continue animating your controls until you've achieved your desired animation.
The Full Body Inverse Kinematic (FBIK) feature for Unreal Engine 5 Early Access allows you to construct IK in Control Rig with a high degree of control and flexibility. This document provides an overview of how to create a FBIK node, configure it's options to achieve your desired pose, and provides a node reference.
Prerequisites
FBIK is a node within the Control Rig Graph, therefore you should have a moderate understanding of the Control Rig Editor and featureset.
You must enable the FullBodyIK plugin. To do this, navigate in the Unreal Editor menu bar to Edit > Plugins and search for FullBodyIK. Ensure the plugin is enabled and restart the editor.
You have imported a Skeletal Mesh Asset into your project.
Creation and Setup
To start, create a Control Rig asset for your Skeletal Mesh Asset. Do this by right-clicking on your Skeletal Mesh Asset and selecting Create Control Rig. This will create a new Control Rig Asset with your skeletal mesh already assigned. The Asset will automatically name itself after the Skeletal Mesh with the suffix _CtrlRig.
Once created, double-click on the Control Rig Asset to open it.
Next, create the FBIK node. In the Control Rig graph, right-click and in the context menu select Hierarchy > Full Body IK.
In the Rig Hierarchy panel, create some controls for your IK end effectors. In this example, controls are created for the Left Leg, Right Leg, and Head bones. Locate the desired bones, right-click them and select New > New Control.
You can rename your controls to better identify them by double clicking on the text and typing in the name.
Make sure your controls are unparented from the Skeleton hierarchy. To do this, right-click the Control in the Rig Hierarchy and select Unparent.
Next, reference the controls into the Control Rig Graph by dragging and dropping the controls from the Rig Hierarchy panel to the Rig Graph panel, then selecting Get Control.
Now, on the Full Body IK node, set your Root bone. In this example a relatively simple FBIK system is being created between feet and head, so it would be best to choose the Hips or Pelvis to be the Root
Press the Add button next to the Effectors array to add new effector pins to your FBIK node. Do this for each control. Within each Effector, set the corresponding Bone value for each control. In this example, Head_CTRL is the control for the head bone, and so forth. Once set, hook the Transform pins from the controls to their respective Effector Transform pin.
You should now have a rudimentary FBIK setup for your character. Feel free to manipulate the controls within the Control Rig viewport to see the results.
Bone Settings
You might notice that the IK behavior is not behaving the way you intended. This might be because certain bone settings are not set. Bone Settings are another array element within the Full Body IK node, and are used to control the behavior of each bone that FBIK is affecting.
In the earlier example, the following issues are visible:
The hips are rotating and translating too aggressively.
The legs are not rotating enough.
The ankle is rotating too far upward, causing an unrealistic pose.
Bone Settings can be used to resolve issues like these, in order to best support your preferred IK setup.
Rotation/Position Stiffness
Rotation and Position Stiffness properties are used to control how much a bone in the IK Chain can be affected by the controls and effectors.
In this example, they can be used to address issues seen in the hips. Start by creating a new Bone Setting by pressing the Create button next to Bone Settings. After it is created, assign the pelvis bone to the Bone entry.
Below the Bone entry are the properties for Rotation and Position Stiffness. Use these properties to change the amount the pelvis bone will be affected by the movement of the controls. The range is 0-1; a value of 0 is completely free, whereas a value of 1 is completely locked down.
In this example a value of 0.8 will provide a good amount of stiffness. Once you have entered your stiffness amount, manipulate the controls to see the result.
Preferred Angles
Preferred Angles can be used in order to suggest joints rotate along a specific axis to reach the effector.
In this example, you can use Preferred Angles to address the issues seen in the legs. Start by adding a new Bone Setting by pressing the Create button next to Bone Settings. After it is created, assign the calf_l boneto the Bone entry.
Near the bottom of the new Bone Setting entry are properties for Preferred Angles. Make sure the box for Use Preferred Angles is checked.
Next, expand the Preferred Angles property. This is where you will input your angles of rotation. The size of a number impacts the strength of the preference, so you should keep numbers between 0-90.
Depending on your content setup, your input here might vary from the example. The example mannequin's foot should bend along the Z axis in a positive direction, therefore for this example a value of 45 will be set on the Z property. Once you have entered your angle preference amount, manipulate the controls to see the result.
Limits
Limits can be used to limit the range of, or completely lock, the rotation of bone axes along the IK chain.
In this example, you can use limits to correct the ankle bone bending in an unrealistic manner. Start by adding another Bone Setting by pressing the Create button next to Bone Settings. After it is created, assign the foot_l boneto the Bone entry.
The limit settings are located between the Stiffness and Preferred Angles properties.
Each axis has settings that allow for Free movement, Limited movement within a range, or Locked which disables movement on that axis. If Limited is chosen, then the Min/Max properties are used to define the range of movement.
To correct the ankles rotating too much along the Z axis, set a value of -70 for Min Z and 70 for Max Z, then set the Z axis to Limited. Once you have entered your limit amount, manipulate the controls to see the result.
Node Reference
Pin/Setting Name | Description | |
---|---|---|
Root | The root bone to be specified for the IK chain. | |
Effectors | ||
Bone | The end point bone to be specified for the IK chain. | |
Transform | The transform to use to control the end point bone. Typically this is provided by a Get Transform node linked to a Control that shares the same transform information as the end point bone. | |
Offset Alpha | This property weights the ability for the effector/bone to reach the target control or transform. At 1, the effector does it's best to reach the target transform, at 0 the effector remains at the input pose. | |
Strength Alpha | This property affects the strength of this effector's influence on the IK chain. At 0, the effector will not pull the chain towards it and other effectors will take precedence. | |
Bone Settings | ||
Bone | The Bone these settings are applied to. Can be any Bone in the hierarchy between the Effectors and the Root. | |
Rotation/Position Stiffness | The amount of stiffness to apply to a bone on either rotation or translation. A value of 0 allows for full free movement, whereas 1 will completely lock down the bone. | |
XYZ Limit Setting | A drop-down menu to choose the type of allowed movement on the selected bone's axis. Free allows for full movement, Limited allows for movement within a specified range, and Locked will disable the axis from moving. | |
Min/Max XYZ | If Limited is specified as a Limit Setting, the Min/Max XYZ properties are used to specify the range of movement allowed. | |
Use Preferred Angles | A checkbox to enable the Preferred Angles feature for the selected bone. | |
Preferred Angles | Specify how much the Bone should rotate, in each axis, as the chain is squashed. | |
Settings | ||
Iterations | Increase this value until the effectors converge on their desired goal locations. Iterations increase the CPU cost of the solver, so keep this as low as possible. The introduction of Stiffness, a high Mass Multiplier and Rotation Limits can all affect the convergence rate and necessitate more iterations. | |
Mass Multiplier | This is a global value that affects how much the bones resist rotations and translations. Typical values range between 0.0 and 5.0 with 0.0 being totally loose and 5.0 being very stiff. Higher Mass Multiplier values require more iterations to achieve convergence. | |
Allow Stretch | Enabling this will cause bones along the IK chain to translate to reach their effector. Stiffness values affect this result. | |
Pin Root | Enabling this will pin the translation of the root bone to the original pose. Rotation will still be affected. | |
Debug | ||
Draw Scale | Multiplier that controls size of debug lines. | |
Draw Debug | Enable this to show all affected bones along the IK chain of this FBIK node. |
Comments
Post a Comment