Point SOP

From TouchDesigner 088 Wiki


The Point SOP allows you to get right down into the geometry and manipulate the position, color, texture coordinates, and normals of the points in the Source, and other attributes. The Point SOP also lets you create custom point attributes. It is the complement to the Primitive SOP. If the second input has less points than the first input, the points in the second input will be cycled.

For example, you can create point coloring, or flip the normals of incoming geometry. Using expressions in Position X, Y and Z, you can move any given input point to a new place as defined by the expression with any standard attributes.

PythonIcon.png pointSOP_Class

Parameters - Standard Page

Position /tx /ty /tz - Expressions to translate the XYZ coordinates of a given point can be entered here. The variables to modify here are: $TX, $TY and $TZ.

Simply entering $TX into the Position X field means that the X coordinate of each point that comes in is passed straight through with no modification.

Changing this entry to $TX+5 means that the X coordinate of each point that comes in will be displaced by 5 units. This formula can be expanded to produce many useful effects. Transformations can also be effected in the Y and Z fields.

Keep / Add / No Weight /weight - If you select Add from the pop-up menu, enter formulas here to control the values of the point weights here. The variable to modify is: $WEIGHT. Values for the weight of the point can range from 0.0001 to infinity.

Keep / Add / No Point Colors /diffr /diffg /diffb - Keep leaves the information from the previous SOP in the chain untouched. No removes the attribute, while Add allow you to enter expressions to modify the rgb colors of a given point. The variables to modify are: $CR, $CG and $CB.

Keep / Add / No Alpha /alpha - If you select Add from the pop-up menu, enter formulas here to control the alpha value (transparency) of a given point. The value can range from 0.0 - 1.0. A value of zero will make the given point fully transparent. A value of one will make the point fully opaque. The variable to modify is: $CA.

Keep / Add / No Normals /nx /ny /nz - If you select Add from the pop-up menu, enter formulas to change a given point normal here. Point normals are directional vectors used by other SOPs, such as Turbulence, Facet and Copy. See List of Attributes article for detailed information. The variables to modify are: $NX, $NY and $NZ.

Custom Attrib /custom1 - Creates a custom attribute with this name.

Custom Attrib Size /custom1size - The size of the attribute to create. It'll use however many values from the Value parameter as the size is.

Value /custom1val - The value(s) to assign to the attribute.

Parameters for other custom attributes are the same, but the number is different.

Flipping Normals

You can flip the point normals of incoming geometry by entering: -$NX -$NY -$NZ in the fields with this parameter set to Add Normals. This works, because it takes the existing normals ($NX, $NY, $NZ), and inverts them (the preceding - ).

Keep / Add / No Texture /mapu /mapv /mapw - If you select Add from the pop-up menu, enter formulas here to control the values of the texture coordinates here. The variables to modify are: $MAPU, $MAPV and $MAPW.

Parameters - Particle Page

Keep / Add / No Mass/Drag /mass /drag - Retains, adds, or removes mass and drag attributes for points.

Keep / Add / No Tension /tension - Tension affects the elasticity of the edges the point is connected to.

Keep / Add / No Spring Constant /springk - The Spring Constant is a well known physical property affecting each point.

Keep / Add / No Point Velocity /vx /vy /vz - Retains, adds, or removes the velocity of points. Defines the magnitude of the particle's velocity in the X, Y and Z directions.

Keep / Add / No Up Vector /upx /upy /upz - Creates/Removes the "up" attribute for points. This attribute defines an up vector which is used to fully define the space around a point (for particle instancing or copying geometry).

These are the values for the up vector. The up vector is used in conjunction with the copy template's normals to control the orientation of the copies in the Copy SOP . The variables to modify are: $UPX, $UPY, $UPZ - which are the values of the up vector attribute for the first source; and $UPX2, $UPY2, $UPZ2 - which are the values of the up vector attribute for the second source.

Keep / Add / No Particle Scale /pscale - Creates, removes, or ignores particle scale attributes defined in the Particle SOP. Particle Scale acts as a multiplier for the size of particles. The value of this attribute is multiplied by the size specified in the Particle SOP's render attributes to scale each particle. This attribute is used by the Point Sprite MAT when rendering point sprites.

Parameters - Force Page

Keep / Add / No Radius /radiusf - Used to modify the distance roll-off effect. The roll-off is: r /(r+d^2) Where r is radius, and d is distance from attractor point. If no radius is set, no attenuation is performed.

Keep / Add / No Force Scale /scalef - Multiplier for total force associated with this attractor point.

Both Radius and Force Scale will default to 1 if not created as point attributes.

Radial / Normal / Edge / Directional Force - These four parameters introduce a type of force when created and each has a corresponding multiplier associated with it.

Radial Force /radialf - Force directed towards the attractor point. Positive multipliers are towards while negative are away.

Normal Force /normalf - Force directed along the point normal direction.

Note: A point normal attribute does not have to be present, but if present, it overrides the otherwise computed point normal.

Edge Force /edgef - Only works on primitive face types. The force is directed in the direction of the edge leading from that point. If multiple vertices reference the same point, then the direction is the edge direction of the last primitive referencing the point.

If the face open, then the end point has an edge direction equal to that of the preceding point in that primitive.

Note: When edge forces are added using the Point SOP, the force directions are computed in the Point SOP itself. Thus, any following transformations do not effect these. If you wish for the edge directions to be transformed as well, all transformations must be done before the Point SOP. Only the edge forces function like this.

Directional Force /dirf - An arbitrary directional force, still affected by the distance roll-off function.

Inputs / Geometry Types

Accepts all geometry types.

Local Variables

$PT - The point number.
$NPT - The total number of points.
$CEX, $CEY, $CEZ - The centroid of the SOP.
$TX, $TY, $TZ - The point position.
$BBX, $BBY, $BBZ - The relative position of the point with respect to the bounding box. These variables will always be within 0 to 1.
$NX, $NY, $NZ - The normal of the point.
$MAPU, $MAPV, $MAPW - The texture coordinates of the point.
$CR, $CG, $CB - Red, green and blue color of the point.
$CA - The alpha value for the point.
$UPX, $UPY, $UPZ - The values of the up vector attribute for the first source.
$UPX2, $UPY2, $UPZ2 - The values of the up vector attribute for the second source.

Particle Specific Variables
$PSCALE - The multiplier for the scale of the particles.
$AGE - The number of seconds a particle has been alive.
$MASS - The mass of the point.
$DRAG - The drag coefficient for the point.
$LIFE - Percentage of life used for a point/particle.
$DIST - Distance of the point to an intersected surface. This attribute is created by the Ray SOP.
$VX, $VY, $VZ - Velocity of the point.
$ID - The particle ID associated with the point. This variable is only defined if the point is associated with a particle system that has the particle ID attribute enabled.

Uses / Works in Relation With

  • Manipulating the position, color, texture coordinates and normals of points.
  • Swapping color channels.
  • Swapping or modifying texture coordinates.
  • Fetching attributes from another SOP.
  • Tweaking the orientation of copies in the Copy SOP and instanced geometry.

See Also