Houdini 18.0 Nodes TOP nodes

Command Send TOP node

Sends code to a shared server to execute.

You need to use this node in conjunction with a shared server like the Python Server, Houdini Server Begin, Maya Server Begin, or Nuke Server Begin.

This node sends a command or custom code to a server, depending on what the server accepts. The Houdini Server runs Python code that uses the HOM API, the Maya Server uses MEL or Python, and the generic command server uses the format defined by its server implementation.

When executing Python code, a work_item object is automatically made available. You can use this to read or write data from PDG. This work_item object supports a subset of the pdg.WorkItem API.

myattr_value = work_item.stringAttribValue('myattr')
file_path = save_my_file(myattr_value)
work_item.addResultData(file_path)

The command script is evaluated in a temporary namespace, so any local variables you create will be cleaned up afterwards. If you wish to use a variable in a subsequent command, you should make it global.

# Make myvar visible to subsequent commands on this server
global myvar;
myvar = 42;

Note

When using this node with a Maya Server, the command script is assumed to be Python code unless //mel is the first line of the script, in which case the script text is treated as MEL code. The last line of the MEL script determines the value that is added to the Command Send work_item.

Parameters

Command

Work Item Generation

Whether this node generates static or dynamic work items. You should generally leave this set to "Automatic" unless you know the node’s work items can be computed statically, or that they need to be generated dynamically.

Dynamic

This node always creates dynamic work items: it waits until the upstream work items are known, and generates new work items from the upstream work items.

Static

This node always creates static work items: it creates the number of work items it thinks it needs based on the parameters (and any upstream static items) before the network runs.

Automatic

If the input is static (a static processor, or a partitioner with only static inputs, or a mapper), this node generates static work items, otherwise it generates dynamic work items.

Cache Mode

How the processor node handles work items that report expected file results.

Automatic

If the expected result file exists on disk, the work item is marked as cooked without being scheduled. If the file does not exist, the item is scheduled as normal.

Read Files

If the expected result file exists on disk, the work item is marked as cooked without being scheduled. Otherwise the work item is marked as failed.

Write Files

Work items are always scheduled and the excepted result file is ignored, even if it exists on disk.

Copy Spare Parms to Attributes

When enabled, all spare parms are copied to generated work items as attributes. If there are parms that you want to prevent being copied apply the tag pdg::nocopy.

Remote Script

Specifies the code to send to the shared server.

If the server is a Houdini Server this script should contain Python code and you can make use of the HOM API in it. If the server is a Maya Server, this script should contain python code for the Maya API.

Output

Expected Output From

Determines how the expected output file paths are added.

You can supply the expected output file paths to the node if you want to make use of caching and/or access these paths downstream.

None

No expected outputs are added.

Attribute

The given attribute name is evaluated and added as expected outputs. This can be a file or string array attribute.

File List

The given output file paths are added.

See also

TOP nodes