Houdini 20.5 Nodes TOP nodes

Sort TOP node

Sorts work items by a list of attributes

On this page
Since 17.5

This node reorders input work items based on one more attribute values. The attributes are used to create a tuple that identifies the work item and determines its new index. The ordering of values in the Attributes to Sort By multiparm determine the order that attributes are inserted into the tuple.

For example, consider 3 work item with the buildingnum and floornum attributes. The first two work items both have buildingnum = 2, and floornum = 0 and floornum = 1 respectively. The third work item has buildingnum = 0 and floornum = 0. By specifying “buildingnum” as the first attribute to sort by and “floornum” as the second, the items would would be sorted in the order they were originally in. If “floornum” was put first and “buildingnum” second, the items would be reorder so that the new order is 3, 1, 2 instead.

Parameters

Sort When

Determines when the node performs the sorting operation.

Note

The Sort TOP node needs access to the full set of upstream work items in order to correctly order them.

Input Items are Generated

Sort the input work items after they all have been generated.

Input Items are Cooked

Sort the input work items after they all have been cooked.

Sort Direction

Determines if work items should be sorted in ascending or descending order

Ensure Unique Work Item Indices

When on, the node ensures that all work items have a unique index, even if they have the same sort attribute values. Additionally, if non-sort attributes are specified, the node will preserve the input work item order and flatten their indices.

Attributes to Sort By

The number of attribute conditions. If no attributes are specified the work items will be left in the same order, but will have their indices made unique if Ensure Unique Work Item Indices is enabled.

Name

The name of the attribute.

Type

The type of the attribute, either Float, Integer, or String.

Index

This parameter determines the attribute index that the condition should check.

Examples

Sort Example for Sort TOP node

This example demonstrates how to use the Sort TOP to reorder work items based on an attribute value.

See also

TOP nodes