About
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
.
TextureTag*
const textureTag =
static_cast<TextureTag*
>(
object->MakeTag(
Ttexture));
if (textureTag == nullptr)
textureTag->SetMaterial(material);
if (polygonSelection)
{
const String selectionName = polygonSelection->GetName();
}
GeData data;
{
}
NONE
Definition: asset_browser.h:1
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define Tpolygonselection
Polygon selection - SelectionTag.
Definition: ge_prepass.h:1431
#define Xbitmap
Bitmap.
Definition: ge_prepass.h:1331
#define Ttexture
Texture - TextureTag.
Definition: ge_prepass.h:1420
#define ConstDescID(...)
Definition: lib_description.h:592
@ MATERIAL_COLOR_SHADER
Definition: mmaterial.h:294
maxon::Int32 Int32
Definition: ge_sys_math.h:51
const char * doc
Definition: pyerrors.h:226
@ TEXTURETAG_RESTRICTION
Definition: ttexture.h:24
@ TEXTURETAG_PROJECTION
Definition: ttexture.h:10
@ TEXTURETAG_PROJECTION_UVW
Definition: ttexture.h:17
Allocation/Deallocation
TextureTag instances are created with the usual tools.
- TextureTag::Alloc(): Creates a new TextureTag.
- TextureTag::Free(): Destroys the given TextureTag.
BaseMaterial*
const mat =
doc->GetActiveMaterial();
if (mat == nullptr)
TextureTag* const textureTag = TextureTag::Alloc();
if (textureTag == nullptr)
textureTag->SetMaterial(mat);
object->InsertTag(textureTag);
Properties
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
.
Material
A TextureTag stores a reference to a BaseMaterial based material.
- TextureTag::GetMaterial(): Returns the referenced material.
- TextureTag::SetMaterial(): Sets the referenced material.
TextureTag*
const ttag =
static_cast<TextureTag*
>(
object->GetTag(
Ttexture));
if (ttag == nullptr)
BaseMaterial* const material = ttag->GetMaterial();
if (material != nullptr)
{
}
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
Texture Matrix
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:
- TextureTag::GetPos(): Returns the position of the texture projection.
- TextureTag::SetPos(): Sets the position of the texture projection.
- TextureTag::GetScale(): Returns the scale of the texture projection.
- TextureTag::SetScale(): Sets the scale of the texture projection
- TextureTag::GetRot(): Returns the rotation of the texture projection.
- TextureTag::SetRot(): Sets the rotation of the texture projection.
- TextureTag::GetMl(): Returns the texture projection coordinate system as a matrix.
- TextureTag::SetMl(): Sets the texture projection's coordinate system matrix.
textureTag->SetRot(
Vector { rotation, 0.0, 0.0 });
Float32 DegToRad(Float32 r)
Definition: apibasemath.h:256
maxon::Float Float
Definition: ge_sys_math.h:57
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:140
@ TEXTURETAG_PROJECTION_CUBIC
Definition: ttexture.h:14
Further Reading