Houdini 18.5 Nodes TOP nodes

Work Item Expand TOP node

Expands file lists or partitions into multiple work items

On this page
Since 17.5

This node can be used to expand ether an upstream item’s output file list, array attribute value, or a partition into multiple work items. Example use cases:

A work item has 30 output files associated with it, and you'd like to create a new work item for each of those 30 files.

A partition has some number of work items in it, and you'd like to create a new work item for each group of 5 items in the partition.

A work item has an attribute with multiple values in it, and you wish to do some processing on each value in separate work item.

TOP Attributes

expandsize

integer

The size of the expanded group of work items. For example if Expansion Type is set to a Fixed Count of 3 and there are 12 items in the partition being expanded, expandsize will be set to 4 on each work item. If there were only 11 items in the partition, then the last set of work items would have an expandsize of 2.

expandvalue

When Apply Expansion To is set to Upstream Attribute, work items are created for each value in the specified upstream attribute. This attribute will contain the value from that slice of that array associated with each work item in this node. For other expansion types, this attribute is not set.

Parameters

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.

Apply Expansion To

Determines what will be expanded.

Upstream Output Files

For each upstream work item, expands the output files into more work items.

Items in Upstream Partitions

For each upstream partition, expands the items in the partition into more work items.

Upstream Attribute

For each upstream work, expands the attribute specified in the Expansion Attribute parameter into more work items. Each work item in this node will have an expandvalue attribute that contains a slice of the values from the expanded attribute.

Note: This also works with iterable Python Object attributes.

Expansion Attribute

When Apply Expansion To is set to Upstream Attribute, this parameter specifies the name of the attribute that should be used when expanding work items. The attribute should be an array with a length greater than q, since a work item will be created for each value in the attribute.

Include Expected Output Files

When Apply Expansion To is set to Upstream Output Files, this toggle controls whether or not the expansion should also include upstream expected outputs in addition to regular output files. By default, expected output files are not included.

Expansion Type

Determines the relationship between the elements being expanded and the new work items.

One to One

A new work item will be created for each upstream file or for each work item in the upstream partition.

Fixed Size

The upstream files or partitioned items will be put into fixed size groups based on Value, a new work item will be created for each of those groups.

Fixed Count

The upstream files or partitioned items will be distributed amongst a fixed number of groups based on Value, a new work item will be created for each of those groups.

First N

The first N upstream files or partitioned items will be expanded back into individual work items. The value of N is determined by the Value parameter.

Last N

The last N upstream files or partitioned items will be expanded back into individual work items. The value of N is determined by the Value parameter.

Value

When using an expansion type other than One to One, this parameter determines the way the upstream elements are grouped.

Preserve Source Index

When this toggle is enabled the work item index is set to the index of the upstream partition or output file that was used for expansion.

Set Work Item Frame

When this toggle is enabled, the expanded work items have their frame set based on their position within the list of expanded items.

Frame Start/Step

Determines the starting frame and frame step size, when Set Work Item Frame is enabled. The work item’s frame will be set to step*expansion_index + start.

Examples

WorkItemExpand Example for Work Item Expand TOP node

This example demonstrates how to use the workitem expand node to create additional work items from a list of upstream output files.

See also

TOP nodes