|On this page|
In Houdini, points and primitives have an inherent order, and each point/primitive knows its own "point number" or "primitive number" (its index within the list of points/primitives). This node lets you change the order of points/primitives based on certain criteria.
To change the order of vertices within a primitive, use the Reverse SOP instead.
Sorting by an arbitrary expression
Do not use this node’s option to sort "by expression". Instead, do the following:
Use the Sort node to sort "by attribute" using the key attribute.
This has two advantages over sorting "by expression":
You can view the attribute contents in the Geometry spreadsheet to make sure you are generating the right values.
It is usually much faster, since sorting by attribute can be multi-threaded but expressions with local variables cannot.
The Sort SOP does not properly sort Vector3/Vector4 values or arrays: it only sorts by a single component. However, because the Sort SOP uses a stable sort, you can wire together multiple Sort nodes to sort by multiple components, or multiple attributes.
How to sort the elements.
Do not change the order (preserve the current order).
By vertex order (points only)
Sort points to match the orderof the vertices on the primitives they belong to.
If you have a curve whose point numbers don’t increase along the curve, this will give the points the proper numbers.
Sorts by the element’s X, Y, or Z coordinate.
Reverses the current ordering.
Scrambles the elements into a random order.
Shifts the current element numbers forward by a certain offset. Point numbers at the end of the point list wrap around to the start.
Proximity to point
Orders the elements by how close they are to a certain point.
This can be useful for limiting a point cloud to only the N closest points to a target: sort the points by proximity, then delete all but the first N points.
Orders the elements by their position along a certain line in 3D space. This is similar to "By X/Y/Z" but lets you specify an arbitrary line instead of one of the cardinal axes.
This option lets you sort elements using "key values" generated by an expression, however it is faster and more convenient to use attributes.
Changes the order so elements that are near to each other in 3D space have similar numbers.
Uses the value of an attribute as a "key value" to sort by. For Vector3/Vector4 attributes, the node can only sort by a single component at a time. However, because the Sort SOP uses a stable sort, you can wire together multiple Sort nodes to sort by multiple components, or multiple attributes.
When the sort method is "Random", the seed to use for the random number generator. Different seeds will generate different random orders.
When the sort method is "Shift", the number of places to shift the element numbers forward.
When the sort method is "Proximity", order the elements by how close they are to this point.
When the sort method is "Along vector", if you enter a path to an Object node here, the Sort node will use that objects translate as the vector to sort along.
This lets you sort along a vector from the origin to the object’s current 3D position.
When the sort method is "Along vector", the vector to use for sorting. This vector is signed, so a value of
0, 1, 0 is the equivalent of sorting By Y, while
0, -1, 0 is the reverse.
When the sort method is "By expression", this is the per-element expression to use to generate key values. However, it is faster and more convenient to use attributes.
When the sort method is "By attribute", the name of the attribute to use a the sorting key.
When the sort method is "By attribute", which component of a compound (vector/matrix) value to use as the sorting key. The Sort node can only sort by a single component at a time. However, because the Sort SOP uses a stable sort, you can wire together multiple Sort nodes to sort by multiple components, or multiple attributes.
Reverse point sort
Reverses the sorted ordering computed by the controls above. For example, if you set the sort method to "By X" and turn this on, points are sorted by decreasing X positions.
See the help for Point sort above.
Sort vertices by order in primitives
Sort vertex numbers to have the same order as point numbers in each primitive.
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.