Houdini 22.0 Character KineFX

Graph metadata

Information added to graph nodes and ports.

On this page

This page lists the metadata that are available on graph nodes and ports.

Tags

Tags are identifiers that are used to mark and filter for graph nodes and ports, allowing you to identify groups of nodes and ports independent of their element names. This is useful, as element names on rigs and graphs often change.

Tags are stored on graph nodes in a string array attribute called tags. You can use the APEX path pattern functions %tag() and #<tag> in graph nodes like graph::FindNodes and graph::FindPorts to find nodes and ports that have specific tags on them. You can also use tag functions in prebuilt rig components to label and find nodes and ports in character rigs.

There are a few ways that tags can be created on graph nodes:

  • You can create and edit tags in the APEX network view.

  • You can build a graph (in the APEX network view or using APEX Script) that acts like a “script” to create another graph with tags.

  • Prebuilt rig components can add tags to a character rig. For example, the fktransform component picks up on tags that were previously created on skeleton joints, and places these tags on the corresponding nodes in the rig. Some rig components also add tags on the nodes they create.

Create and edits tags in the APEX network view

To create and edit tags in the APEX network view:

  1. click the node(s) and select Edit Tags.

  2. In the Edit Tags window:

    • To create a tag, click and type in the tag name.

    • To edit a tag, double-click a tag and update the tag.

    • To remove a tag, select the tag and click .

  3. Click Accept. The tags will appear on top of the node:

    Note

    Port tags are stored on the graph node in the format <port>:<tag>. Because of this, single colons “:” should not be used in tag names, but double colons “::” are ok.

Working with tags in APEX Script

Create tags

In this example, we use APEX Script to create a graph with node and port tags:

  1. In an APEX Script SOP, add the following code in the Snippet parameter:

    # Initialize a graph
    graph = ApexGraphHandle()
    
    # Create tags
    tags1: StringArray = ['abc', 'both']
    tags2: StringArray = ['t[out]:abc', 'r[in]:xyz', 'both']
    
    # Add TransformObject nodes to the new graph
    graph.addNode('test1', 'TransformObject', tags=tags1)
    graph.addNode('test2', 'TransformObject', tags=tags2)
    
    # Write out the graph as geometry
    geo = graph.saveToGeometry()
    BindOutput(geo)
    
  2. To see the graph representation of the APEX Script snippet in the APEX network view, set Show to Component Script in the Visualizer section (node layout and colors have been modified for clarity):

  3. To see the new graph created by the APEX Script snippet:

    • Set Bind Output Geometry to <output_node>:<output_port>, in our case, output:geo.

    • In the Visualizer section, set Show to Output 1.

  4. To view the tags in the geometry spreadsheet:

    • The new graph is available on the 1st output of the APEX Script SOP:

    • Select the new_graph node.

    • In the geometry spreadsheet, select Points on the top toolbar:

Find nodes and ports based on tags

In this example, we find nodes and ports with specific tags using the APEX path pattern tag function in graph::FindNodes and graph::FindPorts.

Tip

graph::FindNodes and graph::FindPorts have a name mapping to matchNodes() and matchPorts().

  1. We take the graph created from the previous example and input it into a second APEX Script SOP:

  2. In the find_tags 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, which adds the following code to the beginning and end of your APEX Script snippet:

  3. Specify the input to the find_tags node - in the Invocation section, under Input1 Bindings, turn on Bind To Geometry Parameter and set the parameter to geo. The identifier geo is the graph geometry that is input to the APEX Script SOP, specified in the header from the previous step.

  4. To find the tags in the input graph, add the following code in the Snippet parameter:

    # Find the nodes and ports with the specified tags
    abc_node_tag = graph.FindNodes('%tag(abc)')
    both_node_tag = graph.FindNodes('#both')
    xyz_port_tag = graph.FindPorts('%tag(xyz)')
    
    # Add found node and port names to an array for outputting
    both_nodes = StringArray()
    for n in both_node_tag:
        n_name = n.data()
        both_nodes.append(n_name)
    
    abc_nodes = StringArray()
    for n in abc_node_tag:
        n_name = n.data()
        abc_nodes.append(n_name)
    
    xyz_ports = StringArray()
    for p in xyz_port_tag:
        p_name = p.data()
        xyz_ports.append(p_name)
    
    # Output node and port arrays
    BindOutput(abc_nodes, both_nodes, xyz_ports)
    

    Note

    Even though the port tag is stored on the graph node as r[in]:xyz, only specify the tag name, and not the port name, in the tag function when using graph.FindPorts(). For example, use graph.FindPorts('%tag(xyz)'), not graph.FindPorts('%tag(r[in]:xyz)').

  5. By default, the first entry of Output Dictionary Bindings in the APEX Script SOP Invocation section is filled out with the following:

    • Apex Outputs Group is the set to output. This is the name of the output node in the graph.

    • Output Attrib is set to parms. This is the name of the output dictionary to store the node and port arrays.

  6. To view the found nodes and ports in the geometry spreadsheet:

    • Select the find_tags node.

    • In the geometry spreadsheet, select Detail on the top toolbar.

    • click the entry in the Detail column of the parms attribute and select Inspect:

      "abc_nodes":["test1"]
      
      "both_nodes":["test1","test2"]
      
      "xyz_ports":["r"]
      

Update tags

In this example, we update the tags in a graph using graph::UpdateNode and graph::UpdateNodeTags:

  1. We take the graph created from the previous example and input it into a second APEX Script SOP:

  2. In the update_tags 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.

  3. Specify the input to the update_tags node - in the Invocation section, under Input1 Bindings, turn on Bind To Geometry Parameter and set the parameter to geo.

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

  5. The update_tags node now takes in the input graph and outputs it unchanged. To see the graph output, set Show to Output 1 in the Visualizer section.

  6. To update the tags on the input graph nodes, add the following code in the Snippet parameter:

    new_tags1 = ['new_tag']
    new_tags2 = ['def', 'xform:xyz']
    
    node1 = graph.test1
    node2 = graph.test2
    
    # Adds to existing tags
    graph.UpdateNodeTags(nodeid=node1, tags=new_tags1)
    
    # Replaces existing tags
    graph.UpdateNode(nodeid=node2, tags=new_tags2)
    
  7. See the graph representation of the APEX Script snippet in the APEX network view - in the Visualizer section, set Show to Component Script (node layout and colors have been modified for clarity):

  8. To see the new graph created by the APEX Script snippet, set Show to Output 1 in the Visualizer section:

    Original tags (left); updated tags (right)

Properties

Properties are special metadata that are stored on graphs as detail attributes or on graph nodes as point attributes. Properties are stored in a dictionary attribute called properties, and can contain information like rig parameter limits or the look of a control shape. The animate state picks up on these properties when assembling an animation scene.

Note

There are no port properties.

There are predefined entries in the properties dictionary, and they are listed in the sections below. In addition to the predefined entries, you can also add custom entries to the properties dictionary.

Point properties

Point properties are stored on graph nodes. To view a graph node’s properties:

  • In the APEX network view, click the graph node and select Properties.

    or

  • In the geometry spreadsheet, select Points on the top toolbar. click the entry under the properties column and select Inspect.

The following are the predefined properties on graph nodes:

Property

Type

Description

control

dict

A dictionary that contains information on the look of the control in the viewport. The format of the control dictionary is:

control: {
    color: Vector3
    shapeoffset: Matrix4
    shapeoverride: String
    visibility: Int
}

For example:

"control":{
    "color":[0.5,0,1],
    "shapeoffset":[0.3,0,0,0,0,0.3,0,0,0,0,0.3,0,0,0,0,1],
    "shapeoverride":"torus",
    "visibility":1
}

color

Vector3

The color of the control.

shapeoffset

Matrix4

The position of the control.

shapeoverride

string

The shape of the control.

visibility

int

The visibility of the control in the animate state.

max, min

Vector3

A soft limit on the rig transform parameters. The Vector3 values are the limits on the x, y, and z values of the parameter. The user can control whether or not to enforce the limits or use the limits as a visual indicator in the animate state. See transform limits for more information.

The format of the max and min properties is:

[max|min]:<parameter_name>: [<x_value>, <y_value>, <z_value>]

For example:

"max:t":[5, 5, 5]
"min:t":[-5, -5, -5]

max_lock, min_lock

Vector3

A hard limit on the rig transform parameters. The Vector3 values are the limits on the x, y, and z values of the parameter. This cannot be turned off in the animate state. See transform limits for more information.

The format of the max_lock and min_lock properties is:

[max_lock|min_lock]:<parameter_name>: [<x_value>, <y_value>, <z_value>]

For example:

"max_lock:t":[10, 10, 10]
"min_lock:t":[-10, -10, -10]

mapping

string

Specifies the mapping between rigs/skeletons to TransformObject nodes. This is useful for mapping skeleton joints to controls, or in the case where one rig drives another, mapping the controls between two rigs. This mapping information is stored on the TransformObject node.

The format of the mapping property is:

mapping:<skeleton|rig>: <element_name|APEX_path_pattern>

For example:

"mapping:Base.skel":"C_pelvis"

mapping_xform

Matrix4

Transform data used to bind skeleton joints to their corresponding controls (TransformObject nodes).

The format of the mapping_xform property is:

mapping_xform:<skeleton>: [<transform>]

For example:

"mapping_xform:Base.skel":[0.9,0.3,0.1,0,...]

The mapping and mapping_xform properties can be set using an APEX Map Character SOP, and the other properties can be set using an APEX Configure Controls SOP.

Below is an example of a properties point dictionary attribute on a graph node:

{
    "control":{
        "color":[0.5,0,1],
        "shapeoffset":[0.3,0,0,0,0,0.3,0,0,0,0,0.3,0,0,0,0,1],
        "shapeoverride":"torus",
        "visibility":1
    },
    "max:t":[5, 5, 5],
    "min:t":[-5, -5, -5],
    "max_lock:t":[10, 10, 10],
    "min_lock:t":[-10, -10, -10],
    "mapping:Base.skel":"lowerarm_l",
    "mapping_xform:Base.skel":[0.9,0.3,0.1,0,...]
}

Detail properties

Detail properties are stored on the graph itself. To view a graph’s detail properties:

  1. In the geometry spreadsheet, select Detail on the top toolbar.

  2. click the value of properties and select Inspect.

The following are the predefined properties on graphs:

Property

Type

Description

fps_input

string

The input port on the graph that stores the current frames per second. The input port must be a float value. For example, the property "fps_input":"my_fps" means the graph’s input port my_fps contains the value of the current frames per second.

frame_input

string

The input port on the graph that stores the current frame. The input port must be a float value. For example, the property "frame_input":"my_frame" means the graph’s input port my_frame contains the value of the current frame.

framestart_input

string

The input port on the graph that stores the global start frame. The input port must be a float value. For example, the property "framestart_input":"my_startframe" means the graph’s input port my_startframe contains the value of the global start frame.

frameend_input

string

The input port on the graph that stores the global end frame. The input port must be a float value. For example, the property "frameend_input":"my_endframe" means the graph’s input port my_endframe contains the value of the global end frame.

time_input

string

The input port on the graph that stores the current time. The input port must be a float value. For example, the property "time_input":"my_time" means the graph’s input port my_time contains the value of the current time.

timestep_input

string

The input port on the graph that stores the current time step. The input port must be a float value. For example, the property "timestep_input":"my_timestep" means the graph’s input port my_timestep contains the value of the current time step.

mirror_axis

Vector3

The plane that the rig is mirrored across. The vector is the normal vector of the plane. For example, if the rig is mirrored across the YZ plane, this value is [1, 0, 0]. The default axis is [1, 0, 0].

mirror_pattern

dict

A dictionary that defines how the rig control names are mirrored. The dictionary has two keys - left_pattern and right_pattern. For example:

"mirror_pattern":{
    "left_pattern":"L_*",
    "right_pattern":"R_*"
}

The default mirroring pattern is *_l and *_r.

sidefx::wire_style

int

The wiring style for the graph:

  • 0 - straight lines

  • 1 - rounded connections

Below is an example of a properties detail dictionary attribute on a graph:

{
    "fps_input":"my_fps",
    "frame_input":"my_frame",
    "mirror_axis":[1,0,0],
    "mirror_pattern":{
        "left_pattern":"L_*",
        "right_pattern":"R_*"
    },
    "sidefx::wire_style":1,
    "time_input":"my_time"
}
To...Do this

To add and modify the properties dictionary

Use an Attribute Adjust Dictionary SOP.

For point properties:

For detail properties:

View the properties on a graph

For point properties:

  • In the APEX network view, click the graph node and select Properties.

    or

  • In the geometry spreadsheet, select Points on the top toolbar. click the entry under the properties column and select Inspect.

For detail properties:

  • In the geometry spreadsheet, select Detail on the top toolbar. click the value of properties and select Inspect.

Attributes

APEX graph geometry have the following attributes:

Name

Class

Type

Description

name

point

string

The name of the node.

callback

point

string

The callback name (node type) of the node.

Cd

point

float

The color of the node.

portname

vertex

string

The name of the port.

portalias

vertex

string

The subport name or renamed ports.

portindex

vertex

int

The index number of the port.

parms

point

dict

A dictionary of default values for the ports.

tags

point

string[]

An array of strings that are used as identifiers for graph nodes. Tags can be matched using the APEX path pattern function %tag() in graph nodes like graph::FindNodes.

properties

point

dict

A dictionary of additional metadata on the node. Properties can be matched using the APEX path pattern function %properties() in graph nodes like graph::FindNodes.

Callbacks

There are special callback names for some of the graph elements:

Node

Callback name

Graph input node

__parms__

Graph output node

__output__

Subnet

__subnet__

Sticky note

__stickynote__

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