Houdini 18.0 Nodes TOP nodes

Attribute Create TOP node

Creates or sets an attribute on all incoming work items.

On this page

This node lets you change internal attributes (pdg_index, pdg_frame, pdg_priority, pdg_output), as well as create/set custom attributes. If an attribute with the given name and type already exists, this will overwrite its size/value.

Parameters

Create

Work Item Generation

Whether this node generates static or dynamic work items. You should generally leave this set to "Automatic" unless you know the node’s work items can be computed statically, or that they need to be generated dynamically.

Dynamic

This node always creates dynamic work items: it waits until the upstream work items are known, and generates new work items from the upstream work items.

Static

This node always creates static work items: it creates the number of work items it thinks it needs based on the parameters (and any upstream static items) before the network runs.

Automatic

If the input is static (a static processor, or a partitioner with only static inputs, or a mapper), this node generates static work items, otherwise it generates dynamic work items.

Create When

If you turn this on, the node only creates/sets the attribute(s) below to work items where the given expression evaluates to a non-zero value. For example, to only set an attribute on work items whose index is greater than 5, turn on Create when and set the expression to @pdg_index > 5.

Work Item

Index

If you turn this on, the node sets each work item’s internal index attribute to the result of the given expression. For example, to set each work item’s index to be the value of its foo attribute minus one, turn on Index and set the expression to @foo - 1.

Frame

If you turn this on, the node sets each work item’s internal frame attribute to the result of the given expression. For example, to set each work item’s frame number to be the value of its source_frame attribute, turn on Frame and set the expression to @source_frame.

Priority

If you turn this on, the node sets each work item’s internal priority attribute to the result of the given expression. Work items with higher priority values are scheduled before work items with lower numbers.

Attributes

The parameters in this section can be used to create work item attributes of various types. Integer and Float attributes can be created with an array size between 1 and 4, and other attribute types can only be set to scalar values. If you need to create attributes that contain an array of strings or have a longer array length, consider using a Python Processor or Python Script instead. Attributes can be created using the PDG work item Python API: pdg.WorkItem.addAttrib.

Strings

Strings

A multi-parm allowing you to add/set one or more string attributes.

Name

The name of the string attribute to add/set.

Existing Name

Determines how to handle a conflict when an existing attribute with the same name is found. If you choose Replace Existing Attribute the node will delete the old attribute and add a one described by this multiparm entry. Update Existing Attribute Value will attempt to update the value if the attribute type matches, otherwise it will issue a warning. Generate Warning and Generate Error will cause the node to issue a warning or error if the attributes types don’t match.

Value

The value of the string attribute. This can be an expression that is evaluated for each incoming work item, however remember that in string parameters you must put expressions inside back-ticks.

Integer Arrays

Integers

A multi-parm allowing you to add/set one or more integer attributes.

Name

The name of the integer attribute to add/set.

Existing Name

Determines how to handle a conflict when an existing attribute with the same name is found. If you choose Replace Existing Attribute the node will delete the old attribute and add a one described by this multiparm entry. Update Existing Attribute Value will attempt to update the value if the attribute type matches, otherwise it will issue a warning. Generate Warning and Generate Error will cause the node to issue a warning or error if the attributes types don’t match.

Tip

If you set this parameter to Update Existing Attribute Value and specify a Size value that is less than the size of an existing attribute array, only the first Size components will be updated. For example, you can use this to update the first three values in a four-component vector without affecting the fourth component.

Size

The vector size of the new integer attribute (1-4). Use 1 for a single scalar value, or 3 for a 3D vector.

Value

The value for the new integer attribute. This can be an expression that is evaluated for each incoming work item.

Float Arrays

Floats

A multi-parm allowing you to add/set one or more float attributes.

Name

The name of the float attribute to add/set.

Existing Name

Determines how to handle a conflict when an existing attribute with the same name is found. If you choose Replace Existing Attribute the node will delete the old attribute and add a one described by this multiparm entry. Update Existing Attribute Value will attempt to update the value if the attribute type matches, otherwise it will issue a warning. Generate Warning and Generate Error will cause the node to issue a warning or error if the attributes types don’t match.

Tip

If you set this parameter to Update Existing Attribute Value and specify a Size value that is less than the size of an existing attribute array, only the first Size components will be updated. For example, you can use this to update the first three values in a four-component vector without affecting the fourth component.

Size

The vector size of the new float attribute (1-4). Use 1 for a single scalar value, or 3 for a 3D vector.

Value

The value for the new float attribute. This can be an expression that is evaluated for each incoming work item.

Python Objects

PyObjects

A multi-parm allowing you to add/set one or more PyObject attributes.

Name

The name of the PyObject attribute to add/set.

Existing Name

Determines how to handle a conflict when an existing attribute with the same name is found. If you choose Replace Existing Attribute the node will delete the old attribute and add a one described by this multiparm entry. Update Existing Attribute Value will attempt to update the value if the attribute type matches, otherwise it will issue a warning. Generate Warning and Generate Error will cause the node to issue a warning or error if the attributes types don’t match.

Expression

The Python expression for the new PyObject attribute. This can be an expression that is evaluated for each incoming work item.

Files

Files

A multi-parm allowing you to add/set one or more output file paths. (TOPs tracks, for each work item, the file paths of files created by that work item. Often the item’s work script updates this information automatically, but you can also use this node to set it "manually").

Create As

Output File

The file is added to the work item’s output file list.

File Attribute

The file is added to the work item as an attribute with the "file" type.

Attribute Name

When Create As is set to Attribute, choose the name of the created attribute.

Existing Name

This parameter is only used when Create As is set to Attribute. Determines how to handle a conflict when an existing attribute with the same name is found. If you choose Replace Existing Attribute the node will delete the old attribute and add a one described by this multiparm entry. Update Existing Attribute Value will attempt to update the value if the attribute type matches, otherwise it will issue a warning. Generate Warning and Generate Error will cause the node to issue a warning or error if the attributes types don’t match.

File Path

A file path to add to each work item’s list of file outputs. This can be an expression that is evaluated for each incoming work item.

File Tag

The file tag to apply to the added file path. For example, file/geo or file/pic. This can be an expression that is evaluated for each incoming work item, however remember that in string parameters you must put expressions inside back-ticks.

Check File Path

Determines if the node should verify that the file path exists and is readable before adding it to work items. You can have the node issue either a warning or error when the file path does not exist, or allow the node to skip file validation altogether.

Examples

example_top_attributecreate Example for Attribute Create TOP node

This example demonstrates how to create attributes for workitems of TOP nodes.

See also

TOP nodes