The maxon::MeshAttributeClassInterface allows to implement a new mesh attribute. Such a mesh attribute describes any kind of data assigned to the points of a mesh or the polygon points of a mesh. Such data could be normal data, UV coordinates, vertex colors etc.
The data is stored in a CustomDataTag that also gives access to the data assigned to a specific polygon object. See CustomDataTag Manual.
The behaviour of this CustomDataTag is defined by implementing maxon::CustomDataTagClassInterface and maxon::CustomDataTagDisplayInterface.
A maxon::MeshAttribute represents the data assigned to a point or polygon point. It can be accessed from the CustomDataTag:
See CustomDataTag Manual.
A new mesh attribute is introduced by using the macro MAXON_MESHATTRIBUTE: The created data type name is the given name plus "_MESHATTRIBUTE"
An implementation of maxon::MeshAttributeClassInterface defines how the custom mesh data should be interpolated. This allows to automatically calculate correct values for new points or polygons that are created in various modeling operations.
An implementation must be registered at CustomDataTagDisplayClasses.
The data type handled by this attribute is accessed with:
The interpolation of attribute values is defined with:
Further mathematical operations on the attribute values are defined with:
An implementation of maxon::CustomDataTagClassInterface defines how the CustomDataTag that stores the custom data should behave. Such an implementation can also be easily be written with the MAXON_CUSTOMDATATAG macro. maxon::CustomDataTagClassInterface is based on maxon::MeshAttributeClassInterface.
An implementation of maxon::CustomDataTagDisplayInterface is optional. It defines how an internal scene hook should draw the attribute data in the viewport. An implementation must be registered at maxon::CustomDataTagDisplayClasses.
See also BaseView / BaseDraw Manual.