CHOP to SOP

From TouchDesigner Documentation
Jump to: navigation, search

Summary
[edit]

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.pngchoptoSOP_Class


Parameters - Page

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

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

Start Position startpos - -

  • X startposx -
  • Y startposy -
  • Z startposz -

End Position endpos - -

  • X endposx -
  • Y endposy -
  • Z endposz -

Method method - - The sample data fetch method:

  • Static 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 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 chanscope - The names to use to modify the attributes.  

Attribute Scope attscope - 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 organize - Instead of using the point index, use the value of this attribute as the index to use when looking up into the CHOP.  

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

  • One Sample to Each Point onetoone - The samples are simply mapped 1-to-1, each sample is mapped to the next point in order.
  • Resample CHOP to Fit SOP scale - 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 compnml - Creates normals on the geometry.  

Compute Tangents comptang - Creates tangents on the geometry.  


Operator Inputs

  • Input 0 -

TouchDesigner Build:

SOPs
Add • Experimental:Add • Alembic • Align • Arm • Attribute Create • Attribute • Experimental:Attribute • Basis • Blend • Experimental:Blend • Bone Group • Boolean • Box • Bridge • Cache • Cap • Capture Region • Capture • Carve • CHOP to • Circle • Clay • Clip • Convert • Copy • Experimental:Copy • CPlusPlus • Creep • Curveclay • Curvesect • DAT to • Deform • Delete • Divide • Extrude • Facet • File In • Fillet • Fit • Font • Force • Fractal • Grid • Group • Hole • Import Select • In • Introduction To SOPs id • Inverse Curve • Iso Surface • Join • Joint • Kinect • Lattice • Limit • Experimental:Limit • Line • Line Thick • LOD • LSystem • Magnet • Material • Merge • Metaball • Model • Noise • Null • Object Merge • Experimental:Object Merge • Oculus Rift • OpenVR • Out • Particle • Point • Experimental:Point • Polyloft • Experimental:Polyloft • Polypatch • Polyreduce • Polyspline • Polystitch • Primitive • Experimental:Primitive • Profile • Project • Rails • Experimental:Raster • Ray • Rectangle • Refine • Resample • Revolve • Script • Select • Sequence Blend • Skin • Sort • Sphere • Spring • Sprite • Stitch • Subdivide • Superquad • Surfsect • Sweep • Switch • Text • Texture • Torus • Trace • Trail • Transform • Trim • Tristrip • Tube • Twist • Vertex • Experimental:Vertex • Wireframe • ZED

An Operator Family which operate on Channels (a series of numbers) which are used for animation, audio, mathematics, simulation, logic, UI construction, and many other applications.

An Operator Family that reads, creates and modifies 3D polygons, curves, NURBS surfaces, spheres, meatballs and other 3D surface data.

A parameter in most CHOPs that restricts which channels of that CHOP will be affected. Normally all channels of a CHOP are affected by the operator.

Information associated with SOP geometry. Points and primitives (polygons, NURBS, etc.) can have any number of attributes - position (P) is standard, and optional are normals (N), texture coordinates (uv), color (Cd), etc.

Each SOP has a list of Points. Each point has an XYZ 3D position value plus other optional attributes. Each polygon Primitive is defined by a vertex list, which is list of point numbers.