| On this page |
Set driven key is a technique that allows you to configure a control to drive the transforms of other TransformObject nodes. As the driver’s value changes, the driven TransformObject nodes move through a range of poses that are authored ahead of time. This is useful for corrective and automated motion, such as curling a hand as a slider is pulled, or driving a fan of feathers with a single control.
A set driven key is built using two components that work together:
-
An
APEX Rig Pose SOP authors the poses. In the APEX Rig Pose SOP, you can pose the driven controls and set keyframes on an animation layer. This stores the poses as an animation clip on the character.
-
A set driven keys rig component plays back the poses. It reads the animation clip authored by the APEX Rig Pose SOP and maps the driver’s value onto the clip’s frame range, applying the interpolated pose to the driven nodes.
The APEX Rig Pose SOP and set driven keys rig component don’t pass pose values directly through their wires. Instead, they communicate through the animation clip stored on the character.
Tip
The APEX SetDrivenKey recipe is a ready-made setup that wires these two components together. See starting from the recipe for more information.
Drive animation using a control ¶
In this example, we drive the animation on the Electra test geometry using certain controls on Electra:
Author the driven poses ¶
Drive the poses ¶
The set driven keys rig component reads the animation clips created by the APEX Rig Pose SOP and connects them to driver controls:
-
On the
APEX AutoRig Component SOP, set Component Source to Set Driven Keys.
-
Enter the animate state on the APEX AutoRig Component SOP - select the APEX AutoRig Component SOP, turn on its display flag, and click
Animate on the left toolbar or press Enter over the viewport.
-
Add a Setups multiparm entry for each animation clip you want to drive. Click
for add multiple setups. In our example, we create two Setups, one for the dance animation and another for the head rotation animation.
-
For the dance animation multiparm entry, set the following in the Settings tab:
-
Set Animation Layer to the animation layer created in the APEX Rig Pose SOP that contains the dance animation,
dance. -
Set Start Frame and End Frame to the animation start and end frames. In our example, the dance animation goes from frames 1 to 24, so we set Start Frame to
1and End Frame to24. -
Turn on T, R, and S to specify the channels that are animated (translate, rotate, scale).
-
Set Clip Path to the
.clipin the character folder structure that contains the dance animation, in our example,riganimation/default.clip/.
-
-
In the Driven tab, set Nodes to the TransformObject nodes to drive. This field accepts APEX path patterns, so you can specify the tags on the node, for example,
#<tag>. In our example, we can leave Nodes at the default of “*”. -
We want the left foot to drive the animation. In the Driver tab:
-
Set the Driver parameter to the control that drives the animation - click
beside Driver, select the left foot control in the viewport, and press Enter over the viewport. The Driver parameter is automatically populated with the control name.
-
Specify the specific channel that drives the animation by appending the channel to the driver’s name with a colon. In our example, we want the vertical position of the left foot to drive the dance animation, so we set Driver to
L_footAnkle_ik:ty.Note
If the Driver parameter is not set to an existing control and channel, the set driven keys component creates a slider in the component’s
menu that drives the animation:
-
If you don’t append a channel to the control name, a slider set to the name of the Driver is created in the component’s
menu. For example, if you set Driver to
L_footAnkle_ik, a slider namedL_footAnkle_ikis created in the component’smenu. In this case, the left foot control doesn’t actually drive the animation; a slider named
L_footAnkle_ikdrives the animation. -
If you set Driver to a control name that doesn’t already exist, a slider with the specified name is created in the component’s
menu.
-
If you leave Driver empty, a slider with the Animation Layer name is created in the component’s
menu.
Drive animation using the gear menu slider -
-
Set Fit Min and Fit Max to the driver values that map to the Start Frame and End Frame of the clip. We set Fit Min to
0and Fit Max to0.25.Dance animation driven by the left foot
-
-
If you haven’t added a multiparm entry for the head rotation animation, click
beside Setups.
-
For the head rotation animation multiparm entry, set the following in the Settings tab:
-
Set Animation Layer to
head. -
In our example, the head rotation animation goes from frames 1 to 24, so we set Start Frame to
1and End Frame to24.
-
-
We want to drive the head animation with the left hand rotation, so in the Driver tab:
-
Set Driver to the rotation channel of the left hand control,
L_armTarget_ik:rx. -
Set Fit Min to
0and Fit Max to-180.Head animation driven by the left hand rotation Note
If multiple animation layers drive the same control, the layer listed lower down in the set driven keys component takes precedence. In this example, the head rotation animation overrides the head poses from the dancing animation because the
headanimation layer is listed lower in the Setups multiparm.
-
-
To test the set driven keys functionality:
-
Enter the animate state on the APEX AutoRig Component SOP.
-
Select the driver control (or open the
menu to access the slider) and change its value. As the driver moves between Fit Min and Fit Max, the driven nodes play back the poses authored in the APEX Rig Pose SOP.
-
Start from the recipe ¶
The APEX SetDrivenKey recipe puts down a prewired network so you don’t have to build it from scratch:
-
In the network view, type “APEX SetDrivenKey” in the TAB menu and put down the recipe.
-
Connect a character to the input of the recipe. In the example below, we use the
Electra test geometry as the character (in the Electra SOP, set Output to APEX Character):
Pre-wired network created by the APEX SetDrivenKey recipe -
On the APEX Rig Pose SOP, author the driven poses on a new animation layer.
-
Configure the set driven keys rig component to read the animation created by the APEX Rig Pose SOP and specify a driver to drive the animation.
| See also |