Houdini 20.5 Character KineFX

Graphs for deforming geometry

On this page
This feature is still under development. The current functionality is unfinished and subject to change, and may have thin or no documentation. Please bear this in mind when using it.

This page gives an example of a SOP network and the graph rig logic for deforming a 3-joint tube geometry.

SOP network

The SOP network below takes us from the character elements to the animation environment:

  1. The character elements are prepared by creating the skeleton, tube geometry, and capture weights on the geometry.

  2. The rig logic lives in the APEX graph in the bone_deform_rig node.

  3. The create_character node assembles the character elements into a character, and the assemble_scene node adds the character to an animation scene. See assemble data into a packed folder structure for more information.

  4. The animation scene is input into Houdini’s animation environment, the animate state, on the animate node.

Bone deform network

Rig logic

The graph below displays the rig logic in the bone_deform_rig node for deforming a 3-joint tube geometry:

Bone deform rig logic

FK hierarchy

The three TransformObject (green) nodes establish a 3-joint FK hierarchy, with joint_0 as the parent of joint_1, which is the parent of joint_2. The world transforms of the joint_0, joint_1, and joint_2 TransformObject nodes are piped into the skel::SetPointTransforms node, which updates the joints on the skeleton. The output of skel::SetPointTransforms is the animated skeleton, which goes into the sop::bonedeform node.

skel::SetPointTransforms

skel::SetPointTransforms is a skeleton deformer. It takes in transforms and applies them to skeleton joints. It is a special node in that the subports names of the transforms variadic input is important because they map to the joint names on the input skeleton (geo input). For example, changes to the transforms going into the joint_0 subport will update joint_0 on the skeleton.

Important

For this reason, you need to update the subport names on skel::SetPointTransforms to match the joint names on the skeleton (rename subports by clicking the subport name).

Relationship between the skeleton joint name and skel::SetPointTransforms subport name

Note

The names of the TransformObject nodes do not need to match the skeleton joint names unless you want to update the rest positions of the rig hierarchy from a skeleton using the Update Rest Transforms From Skeleton button on the APEX Edit Graph SOP (see the how-to for information on how to do this).

In our example, the joint names on the skeleton were renamed from the default point_0, point_1, and point_2 to joint_0, joint_1, and joint_2. To rename the joints in the Skeleton SOP:

  1. Select the Skeleton SOP and enter its viewer state (press Enter over the viewport).

  2. On the viewer state toolbar, set the Mode to Modify (or press F over the viewport).

  3. Click each point on the skeleton and rename the joint in the Name field on the viewer state toolbar.

Value node

The rest skeleton is used as a reference for performing geometry deformation. The difference between the transforms of the rest and animated skeleton are calculated, and this difference is used to detemine how the geometry is deformed. skel::SetPointTransforms performs an in-place change of the geometry that is piped in, so we need to use a Value<Geometry> node to make a copy of the rest skeleton before it is piped into skel::SetPointTransforms. If this copy is not created, skel::SetPointTransforms will update the rest skeleton; the rest and animated skeletons will be the same, and no difference transforms will be applied to the geometry deformation.

Bone deformation

The first three inputs of the sop::bonedeform graph node correspond to the three inputs of the Bone Deform SOP.

View geometry deformation

View the geometry deformation in the animate state:

  1. Select the APEX Scene Animate SOP in the network editor and turn on its display flag.

  2. Click Animate on the left toolbar.

Note

If the geometry in the animate state looks mangled, it could be that the rest transforms in the rig graph are not set properly. To set the rest transforms based on the skeleton:

  1. Make sure the names of the TransformObject nodes match the names of the skeleton joints.

  2. Select the APEX Edit Graph SOP in the network editor.

  3. Click Update Rest Transforms From Skeleton in the parameter editor.

  4. When the dialog comes up, select the Skeleton SOP in the network editor, which automatically selects the Skeleton node in the dialog.

  5. Click Accept.

  6. Select the APEX Scene Animate SOP and click Reset All.

  7. Enter the animate state.

How-to

To...Do this

Create a rig hierarchy that corresponds to a skeleton

Use the Import KineFX Skeleton button on the APEX Edit Graph SOP.

Update the rest positions of the rig hierarchy from a skeleton

  1. On the APEX Edit Graph SOP, under the Rigging Scripts section of the parameters, click Update Rest Transforms From Skeleton.

    Note

    For this script to run properly, the TransformObject node names must match the skeleton joint names.

  2. When the dialog comes up, select the Skeleton SOP in your network and click Accept. The restlocal parameters on the TransformObject nodes will be updated (select the TransformObject node and press P to bring up the node parameter window to see the updated values).

KineFX

Overview

Preparing character elements

Rigging with APEX graphs

Building rig graphs with APEX Script

Rigging with rig components

Animating in the viewport

SOP-based animation

Deformation

Animation retargeting

Pre-H20

Panes

Appendix