Houdini 20.0 hapi

hapi.createNode function

Create a node inside a node network. Nodes created this way

In threaded mode, this is an async call!

This is also when we actually check for valid licenses.

This API will invoke the cooking thread if threading is enabled. This means it will return immediately with a call result of hapi.result.Success even if fed garbage. Use the status and cooking count APIs under DIAGNOSTICS to get a sense of the progress. All other API calls will block until the creation (and, optionally, the first cook) of the node has finished.

Also note that the cook result won’t be of type hapi.statusType.CallResult like all calls (including this one). Whenever the threading cook is done it will fill the cook result which is queried using hapi.statusType.CookResult.

Usage

createNode(session: hapi.Session, parent_node_id: int, operator_name: str, node_label: str, cook_on_creation: bool) → int

Create a node inside a node network. Nodes created this way will have their hapi.NodeInfo.createdPostAssetLoad set to True.

session

The session of Houdini you are interacting with. See hapi.Session for more on sessions. Pass None to just use the default in-process session.

parent_node_id

The parent node network’s node id or -1 if the parent network is the manager (top-level) node. In that case, the manager must be identified by the table name in the operator_name.

operator_name

The name of the node operator type.

If you passed parent_node_id == -1, then the operator_name has to include the table name (ie. Object/ or Sop/). This is the common case for when creating asset nodes from a loaded asset library. In that case, just pass whatever hapi.getAvailableAssets returns.

If you have a parent_node_id then you should include only the namespace, name, and version.

For example, lets say you have an Object type asset, in the “hapi” namespace, of version 2.0, named “foo”. If you pass parent_node_id == -1, then set the operator_name as “Object/hapi::foo::2.0”. Otherwise, if you have a valid parent_node_id, then just pass operator_name as “hapi::foo::2.0”.

node_label

(Optional) The label of the newly created node.

cook_on_creation

Set whether the node should cook once created or not.

Returns new_node_id as a int.

hapi