TextureTag Manual
A TextureTag is used to assign a material ( BaseMaterial ) to a BaseObject . The class TextureTag is based on BaseTag so the typical workflows of handling tags apply, see BaseTag and VariableTag Manual .
TextureTag
objects are an instance of
Ttexture
.
// create the texture tag TextureTag * const textureTag = static_cast< TextureTag * > ( object ->MakeTag( Ttexture )); if (textureTag == nullptr ) return maxon::OutOfMemoryError( MAXON_SOURCE_LOCATION );
// apply material textureTag-> SetMaterial (material);
// check if there is a polygon selection tag on the given object // if a selection tag is found, restrict the material to that selection BaseTag * const polygonSelection = object ->GetTag( Tpolygonselection ); if (polygonSelection) { const String selectionName = polygonSelection-> GetName (); textureTag-> SetParameter ( DescID ( TEXTURETAG_RESTRICTION ), selectionName, DESCFLAGS_SET::NONE ); }
// read "Texture" parameter material-> GetParameter ( DescID ( MATERIAL_COLOR_SHADER ), data, DESCFLAGS_GET::NONE );
// if the material uses a bitmap shader, use UVW projection if (data. GetLink (doc, Xbitmap )) { const DescID projectionParam { TEXTURETAG_PROJECTION }; const Int32 projectionUVW = TEXTURETAG_PROJECTION_UVW ; textureTag-> SetParameter (projectionParam, projectionUVW, DESCFLAGS_SET::NONE ); }
TextureTag instances are created with the usual tools.
The parameters of a
TextureTag
can be edited with
C4DAtom::SetParameter()
and
C4DAtom::GetParameter()
. The parameter IDs of a
TextureTag
are defined in
ttexture.h
.
A TextureTag stores a reference to a BaseMaterial based material.
A TextureTag also stores information on how the referenced material is applied to the host BaseObject . If the projection type is not UVW mapping the texture matrix is applied: