On this page | |
Since | 17.5 |
This node is a specialized version of the generic Python Block Begin. This node creates a work items that start a Maya service block, which is terminated using a corresponding Service Block End node.
In order for this node to work, you must first create a Maya service that’s configured to use a specific version of Maya installed on your system. This can be done by clicking the Create Maya Service button on this node, and specifying the path to your Maya installation’s Python interpreter.
-
The work items in this node will start the selected Maya service if it isn’t already running
-
Each work item in this Begin node will lock one of the service worker processes, until the corresponding end block work item finishes cooking.
-
You can use Service Block Send nodes within the block to communicate with the service. The work items within the block execute serially (instead of in parallel), one after another. Alternatively, you can use any node that is able to cook using the services, such as the Python Script TOP.
-
If the first line of your script code code betweens with
//mel
, the code is evaluated using Maya’s MEL language instead of Python.
For more information refer to the service blocks documentation.
Tip
The $HH/help/files/pdg_examples/top_mayapipeline
example shows how you can use this node to create a service block that uses Maya.
TOP Attributes ¶
|
str |
The name of the shared Maya instance associated with the work item. In the case of the begin item, it’s the name of the server that the work item eventually creates. This attribute is deprecated, and is only added to work items when the Server Type parameter is configured to use the old Shared Server service type. |
|
[int] |
This attribute is inherited from the Block Begin Feedback node. The loop iteration number within the set of work items associated with
the loop. Since the iteration number at each level is preserved, this attribute can be an array of values when using nested feedback loops. The loop
iteration value for the outer most loop is stored in |
|
int |
This attribute is inherited from the Block Begin Feedback node. Tracks which loop the work item is associated with. This attribute is relevant when generating multiple independent loops in the same Block Begin Feedback node, like when driving the Block Begin Feedback node with a Wedge node. |
|
int |
This attribute is inherited from the Block Begin Feedback node. The total number of iterations in the loop. |
Parameters ¶
Node ¶
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.
Session Count from Upstream Items
When on, the node creates a single server work item and a session with the server for each upstream work item. Otherwise, a server item is created for each upstream work item.
Number of Sessions
Specifies the number of sessions to create with the server. Each session work item cooks in serial with other sessions using the same server.
The chain of work items starting from this session item down to the Command Server End node cooks to completion before starting the next session.
This parameter is only available when Session Count from Upstream Items is off.
Copy Inputs For
Determines how input files are copied onto loop items. By default, upstream files are copied onto all input files. However, it is also possible to only copy input files onto the first iteration or none of the loop iterations.
No Iterations
Upstream input files are not copied to the outputs of any loop iteration items.
First Iteration
Upstream input files are copied to the output file list for only the first loop iteration
All Iterations
Upstream input files are copied to the output file list of all iterations.
Cook Loops Sequentially
When this toggle is enabled, loops created by this node cook to completion one at a time. Otherwise, when this toggle is off, independent loops are able to cook in parallel.
Feedback Attributes
When on, the specified attributes are copied from the end of each iteration onto the corresponding work item at the beginning of the next iteration. This occurs immediately before the starting work item for the next iteration cooks.
Tip
The attribute(s) to feedback can be specified as a space-separated list or by using the attribute pattern syntax. For more information on how to write attribute patterns, see Attribute Pattern Syntax.
Feedback Output Files
When on, the output files from each iteration are copied onto the corresponding work item at the beginning of the next loop iteration. The files are added as outputs of that work item, which makes them available as inputs to work items inside the loop.
Server Type
Determines whether this node should create a block that uses Services or a Shared Server. Note that Shared Servers are deprecated in Houdini 20.0.
Service Name
When Server Type is set to Service, this parameter determines the name of the service to use for work items in the block
Reset Service
Determines whether or not service clients should be reset before executing work items. If this node is a service block, the reset operation is only performed once per block loop. Otherwise, the reset operation occurs for each work item in this node.
None
The service client is used as-is. This means that any imported modules, global variables, or scene state are preserved between work item cooks.
Reset Client
The service client is sent the “reset” command, which clears state but does not restart the service process.
Restart Client
The service client process is completely restarted before running a work item.
Connect To Existing Server
When on, the work item connects to an existing server instead of spawning a new one.
Server Address
Specifies the existing server address.
This parameter is only available when Connect To Existing Server is on.
Server Port
When Connect To Existing Server is on, specifies the port to use to connect to an existing server. When Connect To Existing Server is off, specifies the TCP port number the server should bind to.
The default value 0
tells the system to dynamically select an unused port. This is the behavior you usually want. If you want to keep the ports in a certain range (and can guarantee the port numbers will be available), you can also use an expression like 9000 + @pdg_index
.
Load Timeout
Specifies the timeout used when performing an initial verification that the shared server instance can be reached. When this timeout passes without a successful communication, the work item for that server is marked as failed.
Maya Python Executable
Specifies the path to the mayapy
executable that should be started.
The default value is $PDG_MAYAPY
, which expects that the environment variable is defined when the work item executes. However, you can set this to an absolute path if it’s known.
These parameters customize the names of the work item attributes created by this node.
Iteration
Specifies the name of the attribute that stores the work item’s iteration number.
Number of Iterations
Specifies the name of the attribute that stores the total iteration count.
Loop Number
Specifies the name of the attribute that stores the loop number.
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.
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.
See also |