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;
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
Determines when this node will generate work items. You should generally leave this set to "Automatic" unless you know the node requires a specific generation mode, or that the work items need to be generated dynamically.
All Upstream Items are Generated
This node will generate work items once all of the input nodes have generated their work items.
All Upstream Items are Cooked
This node will generate work items once all of the input nodes have cooked their work items.
Each Upstream Item is Cooked
This node will generate work items each time a work item in an input node is cooked.
The generation mode is selected based on the generation mode of the input nodes. If any of the input nodes are generating work items when their inputs cook, this node will be set to Each Upstream Item is Cooked. Otherwise, it will be set to All Upstream Items are Generated.
How the processor node handles work items that report expected file results.
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. If upstream work item dependencies write out new files during a cook, the cache files on work items in this node will also be marked as out of date.
Automatic (Ignore Upstream)
The same as Automatic, except upstream file writes do not invalidate cache files on work items in this node.
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.
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.
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.