|On this page|
The Sort op allows you to reorder points and primitives in different ways. Sometimes the primitives are arranged in the desired order, but the point order is not.
To change the order of vertices within a primitive, use the Reverse SOP.
Uses / Works in Relation With
Allow points and primitives to be sorted in different ways.
Sorting along a vector aids with transparency viewing in GL.
Point / Primitive
Type of sort to perform.
Leaves the points and primitives in their original order. This allows one to reorder the points without affecting the primitive order.
By Vertex Order
Sorts points to match the order of the vertices on the primitives that they belong to. If you have a curve whose point numbers do not increase along the curve, this will reorder the point numbers so they match the curve direction.
Sorts points or primitives by increasing X value.
Sorts points or primitives by increasing Y value.
Sorts points or primitives by increasing Z value.
Reverses the order of the points or primitives. The highest numbered becomes the lowest numbered, and vice versa.
Using the random seed, each point or primitive is assigned a random priority. They are then reordered according to that priority. This has the effect of generating a random ordering of the points or primitives.
Shift all of the point or primitive indices forward by an offset. Each point or primitive number gets the offset added to it to get its new number. If this exceeds the number of points or primitives, it wraps around.
Proximity to Point
The distance to a point in space is used as a priority. The points or primitives are then sorted so that the 0th entity is the one closest to that point.
Provides a generalization of the By X, By Y, and By Z methods. Points are sorted in increasing distance along the given vector. This vector is signed. A value of (0, 1, 0) will be the equivalent of sorting By Y, while a value of (0, -1, 0) will be the reverse.
The specified expression is evaluated for each point or primitive. This determines the priority of that primitive, and the entities are reordered according to that priority. The point or primitive with the least evaluated expression value will be numbered 0 after the sort. This will preserve the relative order of entities with the same expression value, so multiple Sort SOPs could be used to perform a multi-key sort.
Points or primitives will be reordered so that objects that are close together in space are likely to have similar indices. This option can help to improve the performance of random access algorithms such as ray tracing, since nearby primitives will reside close together in memory - improving the effectiveness of the CPU cache.
Points or primitives will be reordered in ascending values of the given attribute. Only one component of an attribute is sorted, but since the sort is stable multiple passes could be done to sort by multiple keys.
String, integer, and float attributes are supported.
Seed used for random number generator in Random sort.
Amount to shift point/primitive order in Shift sort.
Position to reference when sorting by proximity to point.
Sort along a vector specified by object’s xform
Specify an arbitrary vector to sort along
Specifies an expression to sort by. Each object is reordered so the elements who evaluated to a higher expression value will be found after those with a lower value. Elements with equal expression value maintain their relative position.
The name of the attribute to sort by. Must be a float, integer, or string attribute.
Which component of an attribute to sort by. The attribute
component 2 will sort by Z, for example.
Reverse Point Sort
The sense of the point sort is reversed.
When Point Sort is set to No Change, the points are still reversed.
Reverse Primitive Sort
The sense of the primitive sort is reversed.
When Primitive Sort is set to No Change, the primitives are still reversed.
Sort Vertices by Order in Primitives
When enabled, vertices are sorted to match the order in which they first appear in a primitive.
1 - Source data
Any geometry type.
The following examples include this node.