CHOP to SOP

From TouchDesigner 088 Wiki

11 CHOPtoSOP.jpg

Summary

The CHOP to SOP takes CHOP channels and generates 3D polygons in a SOP. It reads sample data from a CHOP and converts it into point positions and point attributes. This makes it complementary to the SOP to CHOP. The Channels created by the SOP to CHOP can be modified and then re-inserted into the SOP network via a CHOP to SOP.

By default, the SOP is a line from (-1 0 0) to (1 0 0) containing one point for every sample in the CHOP.

It matches the input channels to the Channel Scope (tx ty tz) where possible. If tx or ty or tz don’t match anything, it just uses the value from the default line, and it only shows a Warning.

The simplest thing to do is to send it a channel named ty, which will make a 3D curve that looks like the CHOP curve.

This does what a Point SOP with a op('wave1')['chan1'].eval(0) function can do, but is much faster.

By using point groups from the incoming SOP, the channels can be inserted only into the group's points.

The CHOP to SOP also supports custom attributes. If the user maps a channel to an attribute that is not found, that attribute is added to the points. Currently, all custom attributes are floats and of size = 1.

In its default state it will attempt to replace the point positions (P(0) P(1) P(2)) with the channels named tx ty and tz.

The channel and attribute scope are first expanded into individual names and matched on a 1 to 1 basis. If you are filling P it doesn't matter if you specify t[xyz] or tx ty tz, both will replace P(0) P(1) P(2), which can be collapsed to P.

For example: Add custom attributes "Scale", "Twist" or "Roll" to the backbone's points with a CHOP to SOP.

If you connect a SOP to its input, it will use the SOP as a starting geometry versus the default line.

PythonIcon.png choptoSOP_Class

Parameters

Group - Modify only the points within this point group. If blank, all points are modified. Accepts patterns, as described in: Pattern Matching.

CHOP - Specifies which CHOP Network / CHOP contains the sample data to fetch.

Method - The sample data fetch method:

  • Static - Uses one channel for each attribute, and all points use this channel (the first point resides at index 0, the next at 1, and so on). The length of the channels should be at least the number of points modified.
  • Animated - Uses one channel per attribute per point. The channels show the animation of each point's position/attribute values. Your channels should be named with 0, 1, 2, 3, etc. at the end of the names to correspond to each point they will replace (e.g., tx0, ty0, tz0, tx1, ty1, tz1). Your CHOP should have (number of attributes * number of points) channels in it.

Channel Scope - The names to use to modify the attributes.

Attribute Scope - A string list of attributes to modify in the SOP. List of Common Attributes:

  • P - Point position (X, Y, Z) - 3 values
  • Pw - Point weight - 1 value
  • Cd - Point color (red, green, blue, alpha) - 4 values
  • N - Point normal (X, Y, Z) - 3 values
  • uv - Point texture coordinates (U, V, W) - 3 values

See List of Attributes for a complete listing of attributes.

Organize by Attribute - Instead of using the point index, use the value of this attribute as the index to use when looking up into the CHOP.

Mapping - Determines how the CHOP samples are mapped to the geometry points.

  • One Sample to Each Point - The samples are simply mapped 1-to-1, each sample is mapped to the next point in order.
  • Resample CHOP to Fit SOP - If there are more or less CHOP samples than points in the geometry, then the CHOP channels are resampled to interpolate values for all the geometry points.

Compute Normals - Creates normals on the geometry.

Compute Tangents - Creates tangents on the geometry.

Local Variables

None.

See Also