Script Node

This script node allows you to execute arbitrary Python code. The following callback functions may be defined in the script: setup(db): is called before compute the first time, or after reset is pressed compute(db): is called every time the node computes (should always be defined) cleanup(db) is called when the node is deleted or the reset button is pressed Available variables: db (og.Database): The node interface, attributes are exposed like db.inputs.foo Use db.log_error, db.log_warning to report problems og: The omni.graph.core module import statements, function/class definitions, and global variables may be placed outside of the callbacks, and variables may be added to the db.internal_state state object

Installation

To use this Node, you must enable omni.graph.scriptnode in the Extension Manager.

Inputs

Name

Type

Description

Default

execIn

execution

The input execution

Inline Script (script)

string

A string containing a Python script that may define code to be executed when the script node computes. See the default and example scripts for more info.

Use Script File (usePath)

bool

When true, the python script is read from the file specified in ‘Script File Path’, instead of the string in ‘Inline Script’

False

Script File Path (scriptPath)

token

The path of a file containing a Python script that may define code to be executed when the script node computes. See the default and example scripts for more info.

Outputs

Name

Type

Description

Default

execOut

execution

The output execution