Sort SOP

From TouchDesigner 088 Wiki

16 SortSOP.jpg

Summary

The Sort SOP allows you to sort points and primitives in different ways. Sometimes the primitives are arranged in the desired order, but the point order is not. There are many possible combinations. To sort vertices, use the Primitive SOP.

PythonIcon.png sortSOP_Class

Parameters - Point Page

Point Sort /ptsort - Sort the points in the input geometry, according to the following criteria:

  • No Change - No sorting is applied.
  • By Vertex Order - Order points in same order as vertices.
  • By X / Y / Z - Sort according to X ,Y or Z position.
  • Reverse - Reverse the point order.
  • Random - Randomize point order using the specified seed without changing the point positions.
  • Shift - Shift points by the amount specified on the Offset parameter.
  • Proximity to Point - Sort points by their proximity to the specified point.
  • Along Vector - Sorts points along either a user or object-defined vector.
  • Distance to Object - Sorts points based on distance to the object specified in the Vector Object parameter.
  • Closest Neighbor - Reorders points based on next closest. Slow nxn search.

Seed /pointseed - The random seed when Point Sort is set to Random.

Offset /pointoffset - Shift point order by the amount specified on the offset line.

Point /pointprox - The X, Y and Z coordinates to reference when sorting by Proximity to Point.

Vector Object /pointobj - Sort points along a vector defined by the object's transformation values.

Vector /pointdir - Allows you to specify a unique vector along which points can be sorted.

Parameters - Primitive Page

Primitive Sort /primsort - Sort the primitives according to the following criteria:

  • No Change - No sorting is applied.
  • By X /Y / Z - Sort according to X ,Y or Z position.
  • Reverse - Reverse primitive order.
  • Random - Randomize primitive order using the specified seed without changing the primitive positions.
  • Shift - Shift primitives by the amount the specified on the Offset parameter.
  • Proximity to Point - Sort primitives by their proximity to the specified point.
  • Along Vector - Sorts primitives along either a user or object-defined vector.
  • Distance to Object - Sorts primitive based on distance to the object specified in the Vector Object parameter.

Seed /primseed - Random seed when sorting by Random.

Offset /primoffset - Shift primitive order by the amount specified on the offset line.

Point /primprox - The X, Y and Z coordinates to reference when sorting by Proximity to Point.

Vector Object /primobj - Sort primitives along a vector defined by the object's translation.

Vector /primdir - Allows you to specify a unique vector along which primitives can be sorted.

Parameters - Particles Page

Particles are sorted on a per-particle system basis. That is if you have a SOP with 2 different particle system primitives, they are sorted independently of each other.

Particle Sort /partsort - Sort the primitives according to the following criteria:

  • No Change - No sorting is applied.
  • By X /Y / Z - Sort according to X ,Y or Z position.
  • Reverse - Reverse particle order.
  • Shift - Shift particles by the amount the specified on the Offset parameter.
  • Proximity to Point - Sort particle by their proximity to the specified point.
  • Along Vector - Sorts particles along either a user or object-defined vector.
  • Distance to Object - Sorts particles based on distance to the object specified in the Vector Object parameter.

Reverse Results /partreverse - reverses the result from the Particle Sort as defined above.

Offset /partoffset - Shift particle order by the amount specified on the offset line.

Point /partprox - The X, Y and Z coordinates to reference when sorting by Proximity to Point.

Vector Object /partobj - Sort particles along a vector defined by the object's translation.

Vector /partdir - Allows you to specify a unique vector along which particles can be sorted.

Inputs / Geometry Types

Input 1 - Source data, any geometry type.

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.

See Also