About
A CustomDataTag is a BaseTag that stores custom point or polygon data. It is a generalized tag type to store mesh-based data like normals, UVs, vertex colors etc. It can replace dedicated tags like NormalTag, UVWTag or VertexColorTag.
A CustomDataTag gives access to data and functionality implemented with maxon::MeshAttribute, maxon::MeshAttributeClassInterface, maxon::CustomDataTagClassInterface and maxon::CustomDataTagDisplayInterface (see Mesh Attributes Interfaces).
Creation
A CustomDataTag object is created using the usual tools and the specific data type ID:
if (tag == nullptr)
polygonObject->InsertTag(tag);
Definition: c4d_basetag.h:50
Definition: lib_customdatatag.h:48
static CustomDataTag * Alloc(Int32 tagId)
void SetMode(CUSTOMDATATAG_MODE mode)
maxon::Result< void > InitData()
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
#define iferr_return
Definition: resultbase.h:1521
Data Type
The data type stored in a given CustomDataTag is obtained with:
Data
A CustomDataTag can stores either point data (CUSTOMDATATAG_MODE::VERTEX) or polygon point data (CUSTOMDATATAG_MODE::POLYVERTEX):
The number of stored elements is returned with:
The stored vertex data is accessed with these functions:
{
}
Py_ssize_t i
Definition: abstract.h:645
Py_ssize_t count
Definition: abstract.h:640
PyObject * value
Definition: abstract.h:715
Int GetComponentCount() const
void SetVertexData(Int32 vertexIndex, TYPE &&value)
Definition: lib_customdatatag.h:279
Definition: lib_math.h:19
FLOAT Get01()
Returns the next random value in the range of [0..1].
maxon::Int32 Int32
Definition: ge_sys_math.h:60
maxon::Float Float
Definition: ge_sys_math.h:66
maxon::Int Int
Definition: ge_sys_math.h:64
The stored polygon data is accessed with:
{
for (
Int32 polyvertexIndex = 0; polyvertexIndex < 4; ++polyvertexIndex)
{
}
}
void SetPolyVertexData(Int32 polygonIndex, Int32 polyVertexIndex, TYPE &&value)
Definition: lib_customdatatag.h:324
Float64 Float
Definition: apibase.h:222
The maxon::PolyData template class stores data for either a triangle or quad:
for (
Int32 polygonIndex = 0; polygonIndex < polyCount; ++polygonIndex)
{
for (
Int32 pointIndex = 0; pointIndex < 4; ++pointIndex)
{
const maxon::Int colorIndex = 4 * polygonIndex + pointIndex;
cds.vertex_color[colorIndex] =
static_cast<Color32>(color);
}
}
cds.perPolygonVertexColor = true;
const maxon::PolyData< TYPE > & GetPolygonData(Int32 polygonIndex) const
Definition: lib_customdatatag.h:339
Definition: mesh_attribute_utilities.h:14
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:213
float Float32
32 bit floating point value (float)
Definition: apibase.h:207
Col3< Float32, 1 > Color32
Definition: vector.h:76
Further Reading