On this page | |
Since | 17.5 |
You can use this node to generate work items with a command line generated by an expression. This node can also be useful when you want to start a network to generate a certain number of work items that don’t do anything (by leaving the command line blank), so that you can add attributes to them and use them to drive downstream nodes.
This node generates Item Count work items when it has no inputs. If the node has inputs, it generates Item Count work items for each upstream work item.
If you need more advanced functionality, use the Python Processor node instead.
Parameters ¶
Command Line ¶
Generate When
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.
Automatic
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.
Cache Mode
Determines 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 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.
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 expected result file is ignored even if it exists on disk.
Sequential
Makes each generated work item depend on the previous one, so they run in sequence instead of simultaneously. If this node is dynamic, work items can only be made sequential with respect to other work items with the same parent.
Copy Inputs to Outputs
When on, work items in the node automatically copy input files to their output file list. When off, the node assumes that the command line will attach output files to the work items.
Flatten Work Item Indices
Item Count
Sets the number of outgoing work items to generate for each incoming work item. If there are no incoming work items, the node generates this number of outgoing work items.
Index
By default, the node gives the generated work items sequential index
attributes starting at 0
. But when Index is on, the node generates custom index
values from the expression specified in the parameter field. This parameter cannot be used if Flatten Indices is enabled.
Frame
By default, the generated work items inherit the frame
attribute from the corresponding incoming work item. But when Frame is on, the node generates custom frame
values from the expression specified in the parameter field.
These parameters can be used to configure the command line executable that work items will execute when they cook.
Specify Using
Determines how the command line executable is specified.
Custom String
The command line executable is defined by a custom string.
Delay
The command line executable is defined by a delay time.
Command Builder
The command line executable is defined by a multiparm of command line args.
When the Command Builder parameters are used with caching, any arguments specified as output file paths are added as expected outputs on the work items. And if the files do not already exist or the Cache Mode is set to Write Files, then the work items cook normally and the file paths are validated once the work items finish cooking.
Command
Determines the command string for work items in this node.
This parameter is only available when Specify Command Using is set to Custom String.
Delay Time
Determines how long of a delay to use (in seconds). Work items in this node run a generic sleep/wait command line instead of running a custom command line. This parameter can be useful for simulating a slow workload to see how it affects the rest of the network.
For example, you can use this parameter to check whether nodes correctly wait for results before proceeding.
Base Command
Specifies the base command line. This parameter contains the executable and any simple arguments that don’t require the extra features available to the ones specified in the multiparm. The extra arguments specified by Extra Arguments are also appended to the end of the base command.
This parameter is only available when Specify Command Using is set to Command Builder.
Run Command in System Shell
When this toggle is enabled, the command string will be run using the system shell instead of run directly. This makes it possible to use shell language features like pattern matching and expansion
Extra Arguments
Specifies the number of extra arguments to append to the Base Command.
Instead of specifying a command line string using a single expression, you can use this multiparm command builder to compose executable arguments.
You can drive these arguments with upstream files or work item attributes. You can also mark these arguments as command outputs, which adds the values of the arguments as output files on the work items.
If the argument data is in an array, the array values are automatically expanded into strings using a configurable separator.
This multiparm is only available when Specify Command Using is set to Command Builder.
Argument Enabled
When this toggle is enabled the argument is added to the command string. If it is disable the argument is ignored.
Argument Name
The name of the argument, such as -o
or --output
. When necessary, this name should include the '-
'.
Argument Source
The source of the data passed to the argument.
Upstream Output Files
The values come from upstream output files.
Attribute Name
The values come from an attribute name.
Custom Value
The values come from a custom expression.
None
The argument does not have a value, and only the argument name will be included in the command string.
Input File Tag
Determines which tag to use when filtering the files.
This parameter is only available when Argument Source is set to Upstream Output Files.
Attribute Name
Specifies the name of the attribute to use for setting arg data. Since PDG can load the array attribute regardless of its length and convert it to a string, this is useful when looking up array data.
This parameter is only available when Argument Source is set to Attribute Name.
Argument Value
Determines what the argument value should be for each work item.
This parameter is only available when Argument Source is set to Custom Value.
Collapse Arrays To
Determines how arrays of files or attribute values should be handled when adding them to the command line. Arrays can be added as a space-separated list of values, a command separated list, or a list with a custom separator between entries. Alternatively, the entire argument can be copied for each entry in the array.
For example, given an input data array containing the entries ["example", "example1", "example2"]
and an argument name of --input
, the following expansions would take place:
Space-Separated String
executable --input "example" "example1" "example2"
Comma-Separated String
executable --input "example","example1","example2"
String with Custom Separator
Set to #
.
executable --input "example"#"example1"#"example2"
Multiple Arguments
executable --input "example" --input "example1" --input "example2"
This parameter is only available when Argument Source is not set to Custom Value.
Array Separator
This parameter is only available when Collapse Arrays To is set to String with Custom Separator, and its field is located to the right of the Collapse Arrays To drop-down menu.
Specifies the separator used between entries in the array.
Attach Argument as Output File
When on, the value(s) from this argument are attached as output files on the work item. Files are added as Expected Outputs so they work with the Cache Mode parameter. The file is converted to a regular output after the work item cooks, assuming it is found on disk.
Take Ownership of File
Mark the file as owned by the PDG work item. This should be used to indicate that the file was produced by the PDG cook. WARNING: owned Output Files are deleted by menu actions like Delete All File Outputs From Disk.
Custom File Tag
When this parameter is enabled, it can be used to specify the file tag the node uses when attaching output files to the work item. Otherwise, PDG will use the existing tag associated with the file if it was copied from an upstream work item, or pick a tag automatically based on the extension if one does not exist.
You can use these parameters can be used to assign expected output files to the work items to PDG knows what outputs the work items produce when they cook.
Expected Outputs From
Determines how expected output files should be specified.
Attribute Name
When Expected Outputs From is set to Attribute Name, this parameter specifies the name of the attribute that contains the file paths(s).
Custom File Tag
When this parameter is enabled, the custom tag value will be assigned to all output files. Otherwise, PDG will use the existing tag for the file if one has been set, or pick one automatically based on the file extension if a tag does not exist.
Files
When Expected Outputs From is set to File List, this parameter determines the number of file list entries.
Output File
The path to the file.
Schedulers ¶
TOP Scheduler Override
This parameter overrides the TOP scheduler for this node.
Schedule When
When enabled, this parameter can be used to specify an expression that determines which work items from the node should be scheduled. If the expression returns zero for a given work item, that work item will immediately be marked as cooked instead of being queued with a scheduler. If the expression returns a non-zero value, the work item is scheduled normally.
Work Item Label
Determines how the node should label its work items. This parameter allows you to assign non-unique label strings to your work items which are then used to identify the work items in the attribute panel, task bar, and scheduler job names.
Use Default Label
The work items in this node will use the default label from the TOP network, or have no label if the default is unset.
Inherit From Upstream Item
The work items inherit their labels from their parent work items.
Custom Expression
The work item label is set to the Label Expression custom expression which is evaluated for each item.
Node Defines Label
The work item label is defined in the node’s internal logic.
Label Expression
When on, this parameter specifies a custom label for work items created by this node. The parameter can be an expression that includes references to work item attributes or built-in properties. For example, $OS: @pdg_frame
will set the label of each work item based on its frame value.
Work Item Priority
This parameter determines how the current scheduler prioritizes the work items in this node.
Inherit From Upstream Item
The work items inherit their priority from their parent items. If a work item has no parent, its priority is set to 0.
Custom Expression
The work item priority is set to the value of Priority Expression.
Node Defines Priority
The work item priority is set based on the node’s own internal priority calculations.
This option is only available on the Python Processor TOP, ROP Fetch TOP, and ROP Output TOP nodes. These nodes define their own prioritization schemes that are implemented in their node logic.
Priority Expression
This parameter specifies an expression for work item priority. The expression is evaluated for each work item in the node.
This parameter is only available when Work Item Priority is set to Custom Expression.
Files ¶
File Dependencies
A list of files that should be copied to the PDG working directory before the first work item in this node is executed. This can be used to ensure that supporting files like digital assets and custom scripts are available for the work item job.
The specified paths can be absolute or relative to HOUDINI_PATH.
Examples ¶
GenericGenerator Example for Generic Generator TOP node
This example demonstrates how to use generic generators to both prototype setups and to run custom command line executables.
See also |