Houdini 22.0 Character KineFX

Graph templates

Use graph templates to easily add logic to an existing graph.

In APEX Script, a function can be treated like a graph template to easily add logic to an existing graph. You can use APEX Script to write expressions and logic that is bundled up in a function, then insert this function directly into an existing graph to modify its functionality.

In APEX rigging, a character rig is represented as a graph. If you have a function that has, for example, a reverse foot or lookat functionality, you could insert this function into an incoming character rig graph to procedurally build up the character’s final rig.

Note

Calling a function simply executes the function logic in the current APEX Script. To use the function logic in another graph (like an incoming rig), the function must be inserted into the incoming graph.

Graph template example

In this example, we start with an input rig graph that contains only an input and output node:

Original rig graph

We then add a simple mathematical operation to the input rig graph using an APEX Script SOP:

Add logic to rig
  1. In the APEX Script SOP, use the predefined headers to automatically add the APEX Script commands that take in and modify an input graph:

    • Turn on the Header parameter.

    • In the Header section, set Template to Graph.

  2. Specify the input to the APEX Script SOP. In the Invocation section, under Input1 Bindings, turn on Bind To Geometry Parameter and set the parameter to geo.

  3. To output the updated rig graph, set Bind Output Geometry to output:geo.

  4. Add the following code to the Snippet parameter. The code adds function test to the input graph as a subnet using graph::AddSubnet:

    # Functionality to add to the input graph
    def test(a: vector3, b: float) -> tuple(vector3, float):
        a = a * b
        b = b + 1.0
        return a, b
    
    # Add function 'test' to the input graph as a subnet named 'my_test'
    my_subnet = graph.addSubnet(test, 'my_test')
    
    # Connect subnet to the input node of the input graph
    my_subnet.a_in.promote('aa')
    my_subnet.b_in.promote('bb')
    
    # Connect subnet to the output node of the input graph
    my_subnet.a_out.promote('aa')
    my_subnet.b_out.promote('bb')
    
  5. To see the updated rig graph in the APEX network view:

    • On the APEX Script SOP, in the Visualizer section, set Show to Output 1.

      or

    • Connect the 1st output of the APEX Script SOP to a Null SOP, and select the Null SOP.

    Updated rig graph

    Dive into the my_test subnet to view the graph logic of function test from the APEX Script code:

    Contents of subnet 'my_test'

Note

In the example above, graph::AddSubnet is used to add the function to the input graph as a subnet. You could also use graph::Merge to merge the function directly into the input graph without packing it into a subnet. However, the resulting graph could contain multiple graph input and output nodes, which you would then have to connect to the appropriate nodes. The cleaner approach is to use graph::AddSubnet.

Adding rig logic without graph templates

Without using a function as a template, the APEX Script code to create the same logic as the previous example is much more convoluted. In this case, the only way to add functionality to an incoming rig graph would be to:

  1. Add the individual mathematical nodes.

  2. Script each node connection.

  3. Pack up the above logic into a subnet.

  4. Connect the subnet to the main graph.

Below is the same logic as the previous example without using a function as a template:

# Add nodes to graph
mult = graph.addNode('MultiplyExpr', 'Multiply<Vector3,Float>')
add = graph.addNode('AddExpr', 'Add<Float>')
val = graph.addNode('Value_right', 'Value<Float>', parms={'value':1.0})

# Connect Multiply node to graph input and output
mult.a_in.promote()
mult.b_in.promote('b')
mult.result_out.promote('a')

# Connect Add node to graph input and output
add.a_in.promote('b')
add.result_out.promote('b')

# Connect Value node to Add node
val.value_out.connect(add.b_in)

# Pack nodes (preserving the connections) into a subnet
# Output names of subnet is set to default values
node_arr: ApexNodeIDArray = [mult, add, val]
graph.packSubnet('my_test', node_arr)

KineFX

Overview

Preparing character elements

Rigging with APEX graphs

  • APEX graph basics

    Introduction to the APEX graph evaluation framework.

  • APEX graph debugger

    Inspect the values of an APEX graph’s ports within the APEX network view.

  • APEX Script basics for graph building

    An overview of APEX Script, a code interface for building APEX graphs.

  • Graphs for numerical operations

    Example graphs of numerical operations like adding two values, fetching multiple results, and retrieving information from geometry.

  • Graphs for viewport animation

    Example graphs of animate state functionality like creating controls and constraints, and defining joint hierarchies.

  • Graphs for deforming geometry

    Example of a SOP network and APEX graph for deforming a 3-joint tube geometry.

  • Graph metadata

    Information added to graph nodes and ports.

  • APEX path pattern

    A set of rules that allow you to filter and select elements within graphs, skeletons, geometry, and the character folder structure.

  • APEX graph nodes

    APEX nodes provide operations for building up the functionality of APEX graphs, which are used in KineFX to create character rigs and perform other geometry manipulation.

  • APEX updates for H22

    New and updated APEX graph nodes for Houdini 22.

Building rig graphs with APEX Script

Rigging with rig components

Animating in the viewport

  • Animation workflow

    Example networks of adding characters, props, characters, and animation to a scene.

  • Animating in LOPs

    Rig and animate characters and props in the context of a USD stage.

  • Working in the animate state

    Select and manipulate controls, define transform limits for controls, and add skin controls to a character.

  • Animate state menus and HUDs

    Menus, HUDs, toolbars, and options in the animate state.

  • Animate state hotkeys

    Hotkeys available in the animate state.

  • Posing

    Pose characters in the animation scene by using locators, copying and pasting controls, and mirroring poses.

  • Motion paths

    Visualize the motion of controls as curves in 3D space.

  • Constraints

    Create relationships between controls in the animate state.

  • Dynamic motion

    Add physically-accurate projectile motion to your animation in the animate state.

  • Ragdoll

    Add a ragdoll simulation to your animation in the animate state.

  • Full body IK

    Apply full body inverse kinematics to pose the character using high-level targets rather than manipulating individual joints.

  • Secondary motion

    Add physically-accurate effects like lag/overshoot, jiggle, and spring to your animation in the animate state.

  • Control selection sets

    A tree view of controls, selections, and selection sets for the animate state. Allows management of control selection and visibility.

  • Motion mixer

    Combine and edit the animation clips of multiple characters in a timeline-based view.

  • Character picker

    Create a 2D layout with simple buttons for selecting character controls in an animation scene.

  • Animation catalog

    Save, manage, and apply animations and single-frame poses to an animation scene.

  • Animation layers

    Create multiple layers of animation without affecting the original animation.

  • Animation toolbar

    A customizable toolbar consisting of simple slider tools that quickly apply modifications to animation controls and curves.

  • Animation bookmarks

    Frame markers that help organize and identify the different parts of your animation.

Customizing the animate state

SOP-based animation

  • Physics-based motion

    Add physically-accurate motion to your animation using the Projectile Motion and Pendulum Motion SOPs.

  • Ragdoll simulations

    Add a ragdoll simulation to your animation using the Ragdoll Solver SOP.

Deformation

  • Blend shapes

    Create blend shapes using blend shape SOP nodes.

Animation retargeting

Pre-H20

Panes

  • Motion mixer

    A timeline-based view of the animation clips and motion effects of multiple characters.

  • Character picker

    Create a 2D layout with simple buttons to select character controls in an animation scene.

  • Rig tree view

    A hierarchical view of character components, including packed character folders, KineFX rigs, and Object node rigs.

  • Animation editor

    View and edit animated parameters and their transitions between keyframes.

  • Geometry spreadsheet

    Displays details about the geometry selected in the network editor.

Appendix