Houdini 12 Nodes Surface nodes

Reorders points and primitives in different ways.

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.

Tip

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.

## Parameters

### Point / Primitive

Point/Primitive Sort

Type of sort to perform.

 No change 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. By x Sorts points or primitives by increasing X value. By y Sorts points or primitives by increasing Y value. By z Sorts points or primitives by increasing Z value. Reverse Reverses the order of the points or primitives. The highest numbered becomes the lowest numbered, and vice versa. Random 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 Shift all of the point or primitives 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. Along Vector 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. By Expression 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.
Seed

Seed used for random number generator in Random sort.

Offset

Amount to shift point/primitive order in Shift sort.

Point

Position to reference when sorting by proximity to point.

Vector Object

Sort along a vector specified by object’s xform

Vector

Specify an arbitrary vector to sort along

Expression

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.

## Inputs

 1 - Source data Any geometry type.

## Examples that use this node

Example forExample name

`.../examples/nodes/dop/flipsolver/DensityViscosity.otl`

`.../examples/nodes/dop/magnetforce/MagnetMetaballs.otl`

`.../examples/nodes/dop/rbdglueobject/ChoreographedTubeBreakup.otl`

`.../examples/nodes/dop/rbdpinconstraint/Chainlinks.otl`

`.../examples/nodes/dop/rbdstate/InheritVelocity.otl`

`.../examples/nodes/dop/ripplesolver/RippleGrid.otl`

`.../examples/nodes/dop/voronoifracturesolver/FractureExamples.otl`

`.../examples/nodes/pop/attractor/AttractToRing.otl`

`.../examples/nodes/sop/clip/ClipParticle.cmd`

`.../examples/nodes/sop/copy/CopyTemplateAttribs.otl`

`.../examples/nodes/sop/copy/ParticleCopyScale.otl`

`.../examples/nodes/sop/creep/CreepParticleTubeA.otl`

`.../examples/nodes/sop/dopimport/LowHigh.otl`

`.../examples/nodes/sop/dopimportrecords/dopimportrecordsexample.otl`

`.../examples/nodes/sop/force/ForceBasic.otl`

`.../examples/nodes/sop/gluecluster/glueclusterexample.otl`

`.../examples/nodes/sop/magnet/MagnetBubbles.otl`

`.../examples/nodes/sop/matchtopology/MatchTopologySphere.cmd`

`.../examples/nodes/sop/particle/FlutteringLeaves.otl`

`.../examples/nodes/sop/particle/ParticleAttractor.otl`

`.../examples/nodes/sop/particle/ParticleExamples.otl`

`.../examples/nodes/sop/particle/ParticleFountain.otl`

`.../examples/nodes/sop/particle/ParticlePusher.otl`

`.../examples/nodes/sop/particle/ParticleTube.otl`

`.../examples/nodes/sop/paste/PasteCones.otl`
`.../examples/nodes/sop/point/AimPointNormals.otl`
`.../examples/nodes/sop/timeshift/PlateBreak.otl`