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)
By default the command script is evaluated in a context that’s shared between all work items that run in the same service block. This means that module imports and variables that are declared in the script are accessible to all subsequent script evaluations. If you want to avoid modifying the global context, you can set the Evaluation Context parameter to Shared, Discard Changes instead. Any imports or declared variables will only be valid for the duration of the script, but the script will still have access to variables from tasks in other nodes. It’s also.possible to change the behavior of the script so that it runs in its own completely standalone context by setting the Evaluation Context parameter to Standalone.
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.
Determines 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 on disk, the work 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 and this node will only check output files for its own work items.
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 expected result file is ignored even if it exists on disk.
This parameter determines which context/namespace the script code should run under. By default the script runs in a shared namespace, so any declared variables or imported modules will be available to subsequent Service Block Send work items. It’s also possible to run the script in its own local context, which is isolated to the work item.
The work item’s script runs in its own local context. It has access to standard modules like
hou, but otherwise runs independently of any previous or subsequent work tiems.
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.