|On this page|
This is a very powerful, low-level node that lets experts who are familiar with VEX tweak point attributes using code.
This node corresponds to the VOP SOP, but uses a textual VEX snippet instead of a VOP network.
This node requires that you understand the vex language. It is very easy to write incorrect code using this node.
This node runs the snippet on every point in the input geometry. The snippet can edit the input geometry by changing attributes. It can access information from other geometry using attributes and VEX functions.
Press on the node to see any error output from the snippet.
You can use the VEX function
chto evaluate parameters. The path is relative to this node (
ch("parm")will evaluate the parameter
parmon this node). This evaluation will be done at the current time.
Unlike the Point SOP, this does not use local variables. Further, all backtick expressions and
$Fvariables will be evaluated at frame 1, not the current time. Use
You can create temporary VEX variables.
Normal VEX variables do not have a
For example, the following code swaps
vector temp = @P; @P = @Cd; @Cd = temp;
sop context provides several global variables you can access,
P, that correspond to attributes.
While you can access these directly, we recommend you use the
The following global variables do not correspond to attributes and may be useful in snippets.
Total number of points.
Current time in seconds.
Current time in frames.
Time increment between frames, in seconds.
A string that can be used to refer to the corresponding input of this SOP in vex operations that take file parameters.
A subset of points in the input geometry to run the program on. Leave this blank to affect all points in the input.
A snippet of VEX code that will manipulate the point attributes.
You can use
@variable_name syntax to access geometry attributes.
Attributes to Create
Only create attributes if their names match this pattern. The default pattern allows any attribute to be created.
You can restrict the created attributes by replacing the
* with a list of allowed names.
Global attributes, such as
id, will be created even if they are not in this list.
The following examples include this node.
This example demonstrates how to use the POP Axis Force node to cause a group of particles to billow upwards.
This example demonstrates the use of the POP Curve Force node to control the flow of a particle sim AND a flip fluid sim.
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.