create_action_graph
Create and wire an OmniGraph Action Graph programmatically to control simulation behavior using nodes, connections, and attribute values.
Instructions
Create and wire an OmniGraph Action Graph.
Builds a complete Action Graph with nodes, connections and attribute values using og.Controller.edit(). This is the programmatic equivalent of creating an Action Graph in the visual editor.
Args: graph_path: USD prim path for the graph (default "/World/ActionGraph"). nodes: List of node definitions. Each dict has: - "path": Node path relative to graph (e.g. "OnPlaybackTick") - "type": OmniGraph node type (e.g. "omni.graph.action.OnPlaybackTick") connections: List of [source_attr, target_attr] pairs for wiring nodes. Each attr is "NodePath.outputs:attrName" or "NodePath.inputs:attrName". values: List of attribute value overrides. Each dict has: - "attr": Full attribute path (e.g. "ScriptNode.inputs:script") - "value": The value to set evaluator: Graph evaluator type (default "push"). script_file: Convenience shortcut — path to a local Python script file. When provided, automatically creates OnPlaybackTick → ScriptNode nodes, wires them, and attaches the script file (sets usePath + scriptPath). The nodes and connections parameters are ignored when script_file is set.
Example (inline script): create_action_graph( values=[ {"attr": "ScriptNode.inputs:script", "value": "def compute(db): ..."} ] )
Example (script file — one-step): create_action_graph( script_file="/path/to/controller.py" )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| graph_path | No | /World/ActionGraph | |
| nodes | No | ||
| connections | No | ||
| values | No | ||
| evaluator | No | push | |
| script_file | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |