|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.
This is a very basic example of how the Clip SOP can be used to control particle flow by cutting it with an infinite plane.
Play animation to see the effects.
The Copy SOP is used to transfer specific attributes from a template to copied primitives. In this example, a sphere is use as a template with color attributes added to the sphere points. A Particle SOP is then used to birth particles from the sphere points.
Next, a Copy SOP does two things:
It copies geometry to the particles.
It transfers the color attribute from the source sphere points to the geometry whose position is based on the particles.
Play the animation to see the effects.
The Copy SOP is used to copy geometry to particles using the Particle SOP as a template. In the example, the Scale parameter of the Copy SOP is used to create the specific effect. The Copy SOP may also be used to control different attributes of the copied geometry beyond mere scale.
Play the animation to see the effects.
This example shows two different ways in which particles can be crept on a surface. In this case, the surface is a contorted tube.
One version shows how particles are crept inside the surface, the other shows how particles are crept outside the surface. This is done by changing the z scale in the Creep SOP, which offsets the particles perpendicular to the surface.
The particles are birthed from a circle that is carved from the tube geometry.
This is an example of how to use the FindShortestPath SOP to find a path through geometry where certain edges are directed edges. Directed edges can only be traversed in one direction.
Try changing the start and end points, as well as the directed edges, to explore how the SOP avoids going the wrong direction, and cannot reach points with only outgoing edges.
This is an advanced example of how to use the FindShortestPath SOP to prefer "central" paths, based on centraily measures computed using FindShortestPath and AttribWrangle. This helps avoid staying too close to walls where avoidable.
Turn on the Display Option > Optimization > Culling > Remove Backfaces to see inside the space more easily. Try visualizing the different centrality measures using the switch node. The same example without considering the centrality of the path is demonstrated in a side branch of the SOP network, in order to see the difference.
This example file uses the Force SOP in conjunction with Metaball SOPs and Particle SOPs to create dynamic animations.
Using the Radial Force Parameter of the Force SOP, particles are puffed in and out. Then, using the Directional Force Parameter, a rotating vortex is created as a metaball spins around an axis.
Press play to view the animation.
This example shows the use of the Magnet SOP, and illustraites its ability to deform geometry.
The Magnet SOP works by using the Density Field of a Metaball as a Magnetic Influence Field on a piece of geometry. The degree to which the Magnetic Field effects the surface it is deforming is based on the distance of that surface to the center of the Metaball.
Here, the Metaballs have been attached to a moving particle system which bounce across a plane. The Metaballs also interact with the plane, causing it to bubble upward as their Fields intersect the surface.
This example demonstrates how the Match Topology SOP lines up the points and primitives between two geometries with equal amounts of points and primitives.
The Tracking Points, Reference Points, and Assume Primitives Match features are utilized to get a perfect match.
This example demonstrates how to create a fluttering leaf simulation by using the Particle SOP.
It also demonstrates how to use the Point SOP to modify point normals, affecting the velocity and direction of particles. Since particles are actually points in space, the Point SOP is a powerful way to control particle attributes.
Press play to watch the simulation.
This example file demonstrates using the Metaball and Force SOPs to affect particles generated by the Particle SOP.
Particles are birthed from the origin and shot towards a still metaball. The metaball has a Force SOP applied to it causing the particles, upon reaching the metaball, to spread away from it out into space.
This example contains five demonstrations of some of the various uses of the Particle SOP.
Creep particles along a surface using a the Creep SOP.
Group birth particles from a group of points on a surface.
Split particles on contact.
Collide particles off a collision object.
Birth particles from a moving object.
Use a metaball to exert force on a particle.
This is an example of creating a fountain from several Particle SOPs and basic modeling.
It demonstrates how to create normal offsets, velocity variances, and collision behaviors to control the motion and look of the particles.
This example uses a Metaball SOP and a Force SOP to push particles side to side as they pass through a particle stream generated by a Particle SOP.
Particles are birthed in the air off of a sphere, while a metaball passes back and forth through, pushing the particles from its path.
Play the animation to see the full effect.
The Particle SOP enables the creation of particles at the SOP level and allows those particles to directly interact with geometry. Furthermore, these particles are in turn treated as point geometry.
In this example, particles are both crept along and collided with a collision tube object. It is possible to also manipulate and control particles in SOPs through the adjustment of point normals (including those of the particles).
This is an example of how to use the Point SOP to orient point normals along a path. This allows for control over the orientation of geometry when copied onto points.
Points are extracted along a spiral on a per frame basis using an expression in the Carve SOP. A cone is copied to these points sequentially and results in an animation along the path.