Tags

In Cinema 4D tags are attached to objects to define additional object properties.

The main tag class is BaseTag and all tags are derived from it. The following tag classes exist:

Tag ClassID

CompositingTag

Tcompositing

DisplayTag

Tdisplay

NormalTag

Tnormal

PointTag

Tpoint

PolygonTag

Tpolygon

SegmentTag

Tsegment

SelectionTag

Tpolygonselection, Tpointselection and Tedgeselection

TangentTag

Ttangent

TextureTag

Ttexture

UVWTag

Tuvw

VertexMapTag

Tvertexmap

All other tags in Cinema 4D are defined with BaseTag.

Examples:

Create a Phong tag and change a parameter:

BaseTag* tag = op->MakeTag(Tphong);
tag->SetParameter(PHONGTAG_PHONG_ANGLELIMIT, true);

Traverse all tags of an object:

BaseTag* tag = op->GetFirstTag();
while (tag)
{
// Do something with 'tag'
tag = tag->GetNext()
}

Create Align to Spline tag and add track with 2 keys:

BaseTag *tag = op->MakeTag(Taligntospline);
if (tag)
{
CTrack* ct = CTrackAlloc(tag, DescID(ALIGNTOSPLINETAG_POSITION), "example");
if (ct)
{
tag->AppendCTrack(ct);
CCurve* cc = ct->GetCurve();
if (cc)
{
CKey* ck = cc->AddKey(BaseTime(0.0));
ck->SetValue(cc, 0.0);
ck = cc->AddKey(BaseTime(1.0));
ck->SetValue(cc, 1.0);
}
}
}
Taligntospline
#define Taligntospline
Align to spline.
Definition: c4d_parameter_ids.h:845
PHONGTAG_PHONG_ANGLELIMIT
@ PHONGTAG_PHONG_ANGLELIMIT
Definition: tphong.h:6
Tphong
#define Tphong
Phong.
Definition: c4d_parameter_ids.h:812
ALIGNTOSPLINETAG_POSITION
@ ALIGNTOSPLINETAG_POSITION
Definition: taligntospline.h:9