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.

TOP Attributes

In addition to the attributes created using the multiparms, this node will also add additional attributes when the Check Files When parameter is set to Work Item is Cooked. The work item needs to store the list of files that need to be validate, and whether those should produce errors or warnings.

validateerrors

int

The list of flags indicating whether the files being validated should produce a warning or error when validation fails. This is the same size as the validatefiles attribute.

validatefiles

string

The list of file paths that should be validated when the work item cooks

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

When on, the node only creates/sets the attribute(s) for work items where the given expression evaluates to a non-zero value. For example, to set only 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

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 is only available when Work Item Priority is set to Custom Expression.

This parameter specifies an expression for work item priority. The expression is evaluated for each work item in the node.

Index

When 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

When 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.

Attributes

You can use the parameters in this section to create work item attributes of various types. Integer and Float attributes take an array size between 1 and 4, and other attribute types only take scalar values.

If you need to create attributes that contain an array of strings or have a longer array length, please consider using a Python Processor or Python Script node instead.

You can also create attributes using the PDG work item Python API: pdg.WorkItem.addAttrib.

Strings

Strings

Multiparm that allows 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.

Replace Existing Attribute

The node deletes the old attribute and add the one described by this multiparm entry.

Update Existing Attribute Value

The node attempts to update the value if the attribute type matches, otherwise it issues a warning.

Generate Warning on Type Mis-match

The node issues a warning if the attribute type doesn’t match.

Generate Error on Type Mis-match

The node issues an error if the attribute type doesn’t match.

Value

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

Note

When Value is an expression, then you must place the expression inside backticks (`).

Integer Arrays

Integers

A multiparm that allows 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.

Replace Existing Attribute

The node deletes the old attribute and adds the one described by this multiparm entry.

Update Existing Attribute Value

The node attempts to update the value if the attribute type matches, otherwise it issues a warning.

Generate Warning on Type Mis-match

The node issues a warning if the attribute type doesn’t match.

Generate Error on Type Mis-match

The node issues an error if the attribute type doesn’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 component 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 integer attribute (1-4). Use 1 for a single scalar value or 3 for a 3D vector.

Value

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

Note

When Value is an expression, then you must place the expression inside backticks (`).

Float Arrays

Floats

A multiparm that allows 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.

Replace Existing Attribute

The node deletes the old attribute and add the one described by this multiparm entry.

Update Existing Attribute Value

The node attempts to update the value if the attribute type matches, otherwise it issues a warning.

Generate Warning on Type Mis-match

The node issues a warning if the attribute type doesn’t match.

Generate Error on Type Mis-match

The node issues an error if the attribute type doesn’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 component 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 float attribute (1-4). Use 1 for a single scalar value or 3 for a 3D vector.

Value

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

Note

When Value is an expression, then you must place the expression inside backticks (`).

Python Objects

PyObjects

A multiparm that allows 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.

Replace Existing Attribute

The node deletes the old attribute and adds the one described by this multiparm entry.

Update Existing Attribute Value

The node attempts to update the value if the attribute type matches, otherwise it issues a warning.

Generate Warning on Type Mis-match

The node issues a warning if the attribute type doesn’t match.

Generate Error on Type Mis-match

The node issues an error if the attribute type doesn’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 multiparm that allows you to add/set one or more output file paths. For each work item, TOPs tracks the file paths of files created by that work item. Often times work items work script update 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.

Replace Existing Attribute

The node deletes the old attribute and adds the one described by this multiparm entry.

Update Existing Attribute Value

The node attempts to update the value if the attribute type matches, otherwise it issues a warning.

Generate Warning on Type Mis-match

The node issues a warning if the attribute type doesn’t match.

Generate Error on Type Mis-match

The node issues an error if the attribute type doesn’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 File Path. For example, file/geo or file/pic. This can be an expression that is evaluated for each incoming work item.

Note

When File Path or File Tag are an expression, then you must place the expression inside backticks (`).

Take Ownership

Mark the file as owned by PDG. 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.

In the case of Output Files, owned additionally indicates the file is owned by the work item. Owned File attributes are not treated as work item Outputs and so they are not deleted by those menu actions.

Check File Path

Determines if the node should verify that the file path exists and is readable before adding it to your work items.

No File Path Validation

The node does not perform file validation.

Error on Missing File

The node issues an error when the specified File Path does not exist.

Warning on Missing File

The node issues a warning when the specified File Path does not exist.

Check File When

Determines if the file paths should be validated during work item generation or when the work items cook. Validating files during the cook is useful if you expect the files to be created when something upstream cooks, as opposed to referring to a existing path already on disk.

Exists Attribute Name

When Check File Path is set to Warning on Missing File, this attribute specifies the name of an integer attribute which will be used to indicate whether the file exists. If the attribute is set to 0, it indicates that the file does not exist, while 1 indicates that the file does exist.

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