| On this page |
When an APEX scene is invoked (using an APEX Scene Animate SOP or
APEX Scene Invoke SOP), it automatically sets various global time values as inputs to the character’s rig graph. The available time parameters are:
-
Current frames per second
-
Current frame
-
Global start frame
-
Global end frame
-
Current time
-
Current time step
Frame value controls the position of a box ¶
In this example, we build a graph that uses the current frame to control the position of a box:
-
In the network editor, put down an
APEX Graph SOP. Select the APEX Graph SOP and go to the APEX network view.
-
In the APEX network view, create an input frame parameter on the graph -
click the graph
input node (
parms) and select Globals ▸ Frame. This is the same as putting down aFrame node. When the graph is executed, the
FRAMEport is set to the current frame ($FF). (Note that if youclick a port, it brings up a different menu.)
Add a frame parameter to the graph -
If you change a graph’s input value from its default, it will appear in the geometry spreadsheet:
-
Select the graph input node, open the node parameter window (press P over the APEX network view), and change the value of FRAME.
-
In the geometry spreadsheet, click
Detail on the top toolbar. The graph’s input parameters are stored in the
parmsdetail attribute on the graph.
-
-
Build the rest of the graph to take the frame input and set it as the translate component of the box. The
geo::Transform node changes the position of the box (see graphs for viewport animation for another example):
Graph to move a box using the frame input -
Execute the graph using an
APEX Invoke Graph SOP:
Execute the graph -
We want to fetch the box geometry on the graph’s
outputnode, so on the APEX Invoke Graph SOP:-
Turn on Bind Output Geometry and set its value to
output:geo(<name_of_output_node>:<geometry_on_output_node>). -
Turn on the display flag on the APEX Invoke Graph SOP to see the box in the viewport.
-
-
As you adjust the value of FRAME on the graph input node, the box moves in the viewport.
Frame value affects the position of the box
Set time parameters using an APEX Invoke Graph SOP ¶
If the graph has an input port with a time parameter, the APEX Invoke Graph SOP can be used to set the value of that parameter. For example, if a graph input node has a
FRAME port, you can use the APEX Invoke Graph SOP to change the frame value:
-
Use the network from the previous example.
-
On the APEX Invoke Graph SOP, turn on Time Bindings.
-
In the Time Bindings section, the Frame parameter is set to the current frame
$FF, so if you scrub the timeline, the x-position of the box changes.
Note
The time parameters in the Time Bindings section only take effect if there is a corresponding port on the graph input node. For example, if the graph has an input port named FRAME, the value from the Frame parameter sets the value of the FRAME port.
Create a custom parameter name ¶
Each time parameter has a default name. For example, the default parameter name for frame is FRAME. This is the name of the port on the graph input node when you put down a Frame node or
click the graph input node and select Globals ▸ Frame. You can change this default name by renaming the port on the graph input node, then adding the following detail property to the graph:
"<time_parameter>_input" : "<custom_name>"
In this example, we change the name of the frame parameter from FRAME to my_current_frame:
-
Use the same graph as the previous example. In the APEX network view, rename the
FRAMEport on the graph input node by ⌃ Ctrl +clicking the
FRAMEport and setting the name tomy_current_frame. -
The graph property
frame_inputsets the input port that stores the current frame. We use anAttribute Adjust Dictionary SOP to add the following property to the graph:
"frame_input" : "my_current_frame"On the Attribute Adjust Dictionary SOP:
-
Set Attribute Name to
propertiesand Attribute Class to Detail. -
In the Number of Entries multiparm entry, set Key to
frame_input, Type to String, and Value tomy_current_frame.
-
-
On the
APEX Invoke Graph SOP, turn on Time Bindings. If the Frame parameter is turned on, the current frame is picked up from the port specified by the
frame_inputproperty (my_current_frame). -
Fetch the output box geometry - on the APEX Invoke Graph SOP:
-
Turn on Bind Output Geometry and set its value to
output:geo. -
Turn on the display flag on the APEX Invoke Graph SOP to see the box in the viewport.
-
As you scrub the timeline, the x-position of the box changes.
-
Time properties ¶
You can use the following graph properties to set a custom name for the time parameters on the graph input node. See the graph metadata page for descriptions of these properties:
Time Parameter |
Graph Property |
Default Name |
|---|---|---|
Current frames per second |
|
|
Current frame |
|
|
Global start frame |
|
|
Global end frame |
|
|
Current time |
|
|
Current time step |
|
|
How-to ¶
| To... | Do this |
|---|---|
|
Create time parameters on the graph |
In the APEX network view, or Put down one of the following time parameter nodes: |