c4d.VariableTag

A tag class that can store multiple elements with variable data size.

Members

VariableTag.__init__(type, count)

Creates a VariableTag.

Note

Use VariableTag children classes to create a UVWTag, NormalTag, PointTag etc.

Here is how to create a vertex map tag and add it to the current polygon object:

tag = c4d.VariableTag(c4d.Tvertexmap, op.GetPointCount())
op.InsertTag(tag)
c4d.EventAdd()
Parameters:
  • type (int) –

    The variable tag type:

    Tline Line.
    Tparticle Particle.
    Tpoint Point - PointTag.
    Tpolygon Polygon - PolygonTag.
    Tsegment Segment - SegmentTag.
    Tsoftselection Soft selection.
    Tsticktexture Stick texture.
    Tuvw UVW - UVWTag.
    Tvertexmap Vertex map.
  • count (int) – The number of data elements in the tag.
Return type:

c4d.VariableTag

Returns:

A variable tag.

VariableTag.GetAllHighlevelData()

Gets the data for the variable tag.

The following code prints the weights from a vertex map tag:

tag = op.GetTag(c4d.Tvertexmap)
if tag:
  print tag.GetAllHighlevelData()

Note

See warning in GetDataCount() for Tnormal / NormalTag.

Return type:Any
Returns:The data for the variable tag. See table in VariableTag Data.
VariableTag.SetAllHighlevelData(data)

Sets the data for the variable tag.

Note

See warning in GetDataCount() for Tnormal / NormalTag.

Parameters:data (any) – The data for the variable tag. See table in VariableTag Data.
VariableTag.GetDataCount()

Gets the number of data elements in the variable tag.

Warning

The Tnormal / NormalTag data contains 12 times more elements than GetDataCount() returns.

Return type:int
Returns:The number of data elements.
VariableTag.GetDataSize()

Gets the size of one data element in bytes.

Return type:int
Returns:The byte size of a data element.
VariableTag.GetLowlevelDataAddressW()

Gets the writable buffer object for the variable tag’s data.

Warning

Use with special care.

Return type:c4d.storage.ByteSeq
Returns:The buffer object.
VariableTag.GetLowlevelDataAddressR()

Gets the read-only buffer object for the variable tag’s data.

Warning

Use with special care.

Return type:c4d.storage.ByteSeq
Returns:The buffer object.

VariableTag Data

The table lists the supported variable tags by VariableTag.GetAllHighlevelData()/SetAllHighlevelData() and their corresponding data.

Tag Data Description
Tpoint list of c4d.Vector The points.
Tpolygon list of c4d.CPolygon The polygons.
Ttangent list of (c4d.Vector, c4d.Vector) The tangents left and right interpolation.
Tsegment list of dict{cnt: int, closed: bool} The segments number of points and closed state.
Tline list of dict{pos: float, t: float} The line points percentage position and original spline point.
Tvertexmap list of float The vertex map values.
Tnormal List[int]eger The normals. Note: Contains 12 times more elements than VariableTag.GetDataCount() returns.
Tvertexcolor list of dict{a, b, c, d: c4d.Vector4d} The vertex colors for a polygon.
Tsoftselection list of float The soft selection values.