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.

The APEX path pattern syntax is a set of rules that allow you to filter and select specific elements within APEX graphs and the packed character format:

APEX graphs

APEX path patterns are used in graph nodes like graph::FindNodes and graph::FindPorts to find specific groups of nodes and ports. APEX path patterns can also be used to filter for metadata on graph nodes like tags and properties. Tags are used extensively in pre-built rig components to label and find nodes in a rig.

Packed character format

APEX path patterns are used in the Unpack Folder SOP to extract specific elements from the nested folder structure of the packed character format.

APEX path pattern syntax

The rules of the APEX path pattern syntax are listed in the table below. The “hierarchy levels” mentioned refer to nested subnets (for APEX graphs) and nested folder structures (for the packed character format).

Syntax

Description

*

Matches any number of characters in a name.

For example, root/*/element_* matches any element two levels down from root whose name starts with element_.

**

Matches any number of hierarchy levels.

For example, **/*ext matches any element that ends with ext at any hierarchy level.

?

Matches any single character.

[]

Matches any single character within the brackets.

For example, root/object[1234] matches elements in root whose names are object1, object2, object3, or object4.

{}

Groups and attributes are put inside braces.

For example, {@name=test3.rig @index=2-3} matches test3.rig, as well as all elements with an index attribute of 2 or 3.

Note

Pattern matching with groups and attributes are only supported for the packed character format, and not for graph elements.

Combine patterns with &, + and -

Multiple patterns can be combined with the &, + and - operators. Pattern matches are applied from left to right.

  • +” or a space operates like an “or” operation. Elements that match any of the patterns separated by a “+” or a space are returned.

  • &” operates like an “and” operation. Any element that matches both of the patterns on either side of the “&” is returned.

  • -” operates like a subtraction operation. Any element that matches the first pattern but not the second pattern is returned.

    For example, root/* - *ext matches all elements in root, but not the elements that end with ext.

()

Parentheses indicate the order of execution for combined patterns.

For example, root/left* - (*arm & *leg) matches all elements in root that start with left, but not the elements that end with arm or leg.

Port syntax

The graph::FindPorts node can filter for graph ports using the following syntax:

<node_path>:<port_name>[in|out][<subport_name>]

  • The optional [in]/[out] specifies whether the port is an input or output port on the node.

  • The optional [<subport_name>] specifies the subport name of the variadic port <port_name>.

For example, joint_*:xform[in][leg] matches the subport named leg on the input variadic port xform on any node that starts with joint_.

Functions

APEX path pattern functions perform specific filtering operations on graphs, graph nodes, and ports. Functions are not used in the packed character format.

In the APEX path pattern syntax, functions are preceded by a “%”, and can take in multiple arguments:

%<function>(<argument1>, <argument2>, ...)

Function

Description

%ancestors(<node_path>, [traverse, inclusive])

Operates on nodes. Finds all the graph nodes that have ancestor connections starting with the node specified in <node_path>.

The inclusive option includes the node in <node_path> in the list of nodes returned. For example, %ancestors(trs_output, inclusive) returns all the ancestors of trs_output as well as trs_output itself.

The traverse option returns all the ancestors of <node_path>, including those within subnets and templates.

As a short form, you can use i for the inclusive option, t for traverse, or it for both.

Examples:

  • %ancestors(<node>)

  • %ancestors(<node>, traverse)

  • %ancestors(<node>, inclusive)

  • %ancestors(<node>, inclusive, traverse)

  • %ancestors(<node>, traverse, inclusive)

  • %ancestors(<node>, i, t)

  • %ancestors(<node>, it)

%callback(<callback_name>)

Operates on nodes. Finds the graph nodes at all subnet levels that match the callback name <callback_name>. Callback names are stored in the callback attribute on a node.

Wildcards can be specified in <callback_name>, for example, graph_*.

%descendants(<node_path>, [traverse, inclusive])

Operates on nodes. Finds all the graph nodes that have descendant connections starting with the node specified in <node_path>.

The inclusive option includes the node in <node_path> in the list of nodes returned. For example, %descendants(trs_output, inclusive) returns all the descendants of trs_output as well as trs_output itself.

The traverse option returns all the descendants of <node_path>, including those within subnets and templates.

As a short form, you can use i for the inclusive option, t for traverse, or it for both.

Examples:

  • %descendants(<node>)

  • %descendants(<node>, traverse)

  • %descendants(<node>, inclusive)

  • %descendants(<node>, inclusive, traverse)

  • %descendants(<node>, traverse, inclusive)

  • %descendants(<node>, i, t)

  • %descendants(<node>, it)

%isconnected()

Operates on nodes and ports. Finds all the nodes/ports that have connections.

%ispromoted()

Operates on nodes and ports. Finds all the nodes/ports that are promoted as an input or output (connected to the graph’s input or output node). It also finds nodes and ports in nested subnets that are promoted up the chain to the top-level graph input or output node.

%properties(<property_name>, [<value>])

Operates on nodes. Properties are stored in the properties dictionary attribute on a node. The %properties function finds all the nodes that contain an entry in its properties dictionary attribute with a key that matches <property_name>.

The value of the property can be provided as an optional second argument.

%tag(<tag_name>)

Operates on nodes and ports. Tags are stored in the tag string array attribute on a node. The %tag function finds the nodes and ports on all subnet levels that contain the tag <tag_name>.

Port tags are stored on graph nodes in the format <port>:<tag>. When using %tag() for ports, only specify the tag name, and not the port name. For example, use %tag(xyz), not %tag(r:xyz).

Wildcards can be specified in <tag_name>, for example, %tag(left_*).

There can be multiple entries within <tag_name>, with each entry separated by a comma or space. For example, %tag(<tag1>, <tag2> <tag3>) matches any node with a tag of <tag1>, <tag2>, or <tag3>.

%valuetype(<type_name>)

Operates on ports. Finds all the ports that have the value type <type_name>, for example, Vector3 or Matrix3.

Wildcards can be specified in <type_name>, for example, Vector*.

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