DAT to SOP

From TouchDesigner 088 Wiki

10 DATtoSOP.jpg

Summary

The DAT to SOP can be used to create geometry from DAT tables, or if a SOP input is specified, to modify attributes on existing geometry. See also the Add SOP.

Without a SOP input, the output is created entirely from the DAT, one SOP point per row of the DAT, except for an optional top row with column headings. The common columns headings include the point number index, point position P(0) P(1) P(2), point weight Pw, the color and alpha Cd(0) Cd(1) Cd(2) Cd(3), texture coordinates uv(0) uv(1) uv(2), and point normal N(0) N(1) N(2). If no index column is specified, row number is used as the point number. If there is no heading for the Point DAT, the list of attributes is assumed to be in order P(0) P(1) P(2) Pw Cd(0) Cd(1) Cd(2) Cd(3) N(0) N(1) N(2) uv(0) uv(1) uv(2) for the first 14 columns.

If an input is used, attributes are read in and replace the ones in the existing geometry. The Merge parameter will be enabled when an input is connected. Depending on the Merge menu setting, either the Points DAT or Primitive DAT parameter used for the merge data. If an input is used, the Points or Primitives DAT must have a column named index. This column is used to match the point or primitive to the incoming geometry by point or primitive number.

Attributes in the columns headings should have column name attrib if it is a single value attribute, or have multiple columns named attrib(0), attrib(1), attrib(2) etc if it is a multiple-value attribute.

Data can also be converted into a form that can be rendered as particles.

Example File : File:SOPtoDATtoSOP.tox

PythonIcon.png dattoSOP_Class

Parameters

Points DAT /pointsdat - DAT with point data. The optional index indicates the point number, if none is specified, row number will be used. Attributes can be specified in attribute_name(attribute_index). If there are no named column headings for the Point DAT, the index column should be removed and the list of attributes is assumed to be in order P(0) P(1) P(2) Pw Cd(0) Cd(1) Cd(2) Cd(3) N(0) N(1) N(2) uv(0) uv(1) uv(2) for the first 14 columns. Sample point data:

   index	P(0)	P(1)	P(2)	Pw	N(0)	N(1)	N(2)
   0		-0.5	-0.5	-0.5	1	0	0	-1
   1		-0.5	0.5	-0.5	1	0	0	-1
   2		0.5	0.5	-0.5	1	0	0	-1
   3		0.5	-0.5	-0.5	1	0	0	-1
   ...

The common columns attributes include point position P(0) P(1) P(2), point weight Pw, the color and alpha Cd(0) Cd(1) Cd(2) Cd(3), texture coordinates uv(0) uv(1) uv(2), and point normal N(0) N(1) N(2). See Point Attributes for a list of attributes.


Vertices DAT /verticesdat - DAT with vertex data. index indicates the primitive number and vindex the vertex number in that primitive. Attributes are specified in the same manner as for points. Sample vertex data:

   index	vindex	uv(0)	uv(1)	uv(2)
   0		0	0	0	0
   0		1	0	1	0
   0		2	1	1	0
   0		3	1	0	0
   1		0	1	0	0
   1		1	1	1	0
   1		2	1	1	1
   1		3	1	0	1
   ...

Common attributes include the color and alpha Cd(0) Cd(1) Cd(2) Cd(3), texture coordinates uv(0) uv(1) uv(2), and vertex normal N(0) N(1) N(2). See Vertex Attributes for a list of attributes.


Primitives DAT /primsdat - DAT with primitive data. The optional index indicates the primitive number, if none is specified, row number will be used. Column headings are required; vertices list the point numbers in order, close indicates whether the primitive is a closed or open curve. Attributes are specified in the same manner as for points. Sample primitive data:

   index	vertices	close	Cd(0)	Cd(1)	Cd(2)	Cd(3)
   0		0 1 2 3		1	0.2	1	1	1
   1		4 5 6 7		1	0.2	0.2	0.5	1
   2		8 9 10 11	1	0.2	0.2	0.2	1

Common attributes include the color and alpha Cd(0) Cd(1) Cd(2) Cd(3). See Primitive Attributes for a list of attributes.


Detail DAT /detaildat - DAT with detail data. Attribute names are specified on the first row and attribute data on the second row. Sample detail data:

   pCaptPath		pCaptData(0)	pCaptData(1)	pCaptData(2)	...
   /bone1/cregion 	0		3.33333		0		...

Merge /merge - Specify whether to merge point data or primitive data. This parameter is only enabled when there is an input connected to the SOP.

  • Points - merge point data.
  • Primitives - merge primitive data.

Add Float Attributes /float - Add a non-standard attribute specified in the point or primitive DAT as a float.

Add Int Attributes /int - Add a non-standard attribute specified in the point or primitive DAT as an int. It will not be added if it has already been specified in the Float attributes.

Add String Attributes /string - Add a non-standard attribute specified in the point or primitive DAT as a string. It will not be added if it has already been specified in the Float or Int attributes.

Build /build - Specifies how to build geometry

  • Use Primitive DAT - Build geometry using data from the Primitive DAT.
  • Connect All Points - Connect all points.
  • Connect Every 2 Points - Connect points in pairs.
  • Connect Every 3 Points - Connect points in triples.
  • Connect Every 4 Points - Connect every 4 points together.
  • Connect Every N Points - Connect every N points together.
  • Polygon with N Rows - Create a polygon grid with N rows.
  • Polygon with N Columns - Create a polygon grid with N columns.
  • Mesh with N Rows - Create a mesh grid with N rows.
  • Mesh with N Columns - Create a mesh grid with N columns.
  • Particle System using All Points - creates a particle system of points.

N /n - Number of points used for building primitives.

Closed U /closedu - Closed curves in U.

Closed V /closedv - Closed curves in V.

Connectivity /connect - Connectivity of polygons.

  • Rows - Creates horizontal lines.
  • Columns - Creates vertical lines.
  • Rows & Cols - Both Rows and Columns. Looks like Quads in wireframe display, but all polygons are open (if the primitive type is polygon). Compare them in the Model Editor.
  • Triangles - Build the grid with Triangles.
  • Quadrilaterals - Generates sides composed of quadrilaterals (default).
  • Alternating Triangles - Generates triangles that are opposed; similar to the Triangles option.

See Also