Main Index : Reference :

VariableTag


Description

A VariableTag class.

Definition

[VariableTag] AllocVariableTag([int] type, [int] count);

class VariableTag : BaseTag
{
public:
  VariableTag();

  [int] GetDataCount();

  [array] GetData();
  [bool] SetData([array] a);
}

Explanation

CINEMA 4D distinguishes between BaseTags which carry a fixed data set in the container and VariableTags which carry a dynamic number of elements. The data is stored as an array. The array is always one-dimensional, so multiple data fields per element are stored as:

Field: a0 b0 c0 a1 b1 c1 a2 ...
Index: 0 1 2 3 4 5 6 ...

So to access the b field of the 6th element (b6) one would use array[6*3+1], where 3 is the number of fields per element.

Allocation

AllocVariableTag( type, count )

[BaseTag] AllocTag([int] type, [int] count);

Allocates a VariableTag with initial size count of the specified type:

TypeDescriptionContent

Tsticktexture

Stick texture tag.

Point data for the stored state

Tparticle

Particle data tag.

Particle data (position + direction + wing + lifetime + bits)

Tbakeparticle

Bake particle data tag.

(see above)

Tuvw

UVW data tag.

UVW data (UVW at point a + b + c + d)

Tpolygon

Polygon data tag.

Polygon data (point index a + b + c + d)

Tsegment

Segment data tag.

Segment data for splines

Tnormal

Normals tag.Contains 12 WORDs per polygon, enumerated like the following:
ax,ay,az,bx,by,bz,cx,cy,cz,dx,dy,dz.
The value is the Real value of the normal vector component multiplied by 32000.0.

Thermite2d

Hermite tangents tag.

Hermite tangents (left + right)

Tvertexmap

Vertexmap data tag.

One float per point of the vertex map

Tpoint

Point tag.

One vector per point

Members

GetDataCount()

[int] GetDataCount();

Returns the number of elements. This is often not the same as the size of the tag's array!


GetData()

[array] GetData();

Returns the tag's array.

SetData( a )

[bool] SetData([array] a);

Sets the array to a. Returns TRUE if successful.