About
The CAWeightTag class represents a weight tag. A weight tag stores weights that define the influence a joint object has on a deformed mesh. The class is defined in the lib_ca.h
header file.
CAWeightTag objects are an instance of Tweights
.
Access
A CAWeightTag tag can be accessed like any other tag, see BaseTag and VariableTag Manual.
for (
Int32 i = 0; i < jointCount; ++i)
{
if (joint == nullptr)
}
Allocation/Deallocation
CAWeightTag instances are created with the usual tools, see Entity Creation and Destruction Manual (Classic).
if (weightTag == nullptr)
Properties
Standard parameters on a CAWeightTag can be edited with C4DAtom::GetParameter() and C4DAtom::SetParameter(). The parameter IDs are defined in tcaweight.h
.
Joints
A CAWeightTag manages a list of references to various joint objects.
if (objects == nullptr)
for (
Int32 i = 0; i < objectCount; ++i)
{
if (baseObject == nullptr)
{
}
}
For each joint the reset (or rest) state is stored:
The JointRestState structure has these members:
for (
Int32 i = 0; i < jointCount; ++i)
{
}
Weights
A CAWeightTag stores weights for each point and joint.
- Note
- The order of weight values does not correspond to the point order.
if (weightCount == 0)
continue;
for (
Int32 weightIndex = 0; weightIndex < pointCount; ++weightIndex)
{
const Float32 weight = weights[weightIndex];
}
for (
Int32 pointIndex = 0; pointIndex < pointCount; ++pointIndex)
{
}
Matrix
Functions
CAWeightTag offers these functions:
Further Reading
static String FloatToString(Float32 v, Int32 vvk=-1, Int32 nnk=-3)
Definition: c4d_string.h:529
void GetWeightMap(Int32 index, Float32 *map, Int32 cnt, Bool includeEffectors=false)
Matrix m_oMi
Inverse matrix of the actual Joint object.
Definition: lib_ca.h:117
Int32 AddJoint(BaseObject *op)
Definition: c4d_baseobject.h:224
Float m_Len
Bone rest length.
Definition: lib_ca.h:118
Float GetWeight(Int32 index, Int32 pntindex)
#define Tweights
Weights.
Definition: ge_prepass.h:1310
maxon::Float Float
Definition: ge_sys_math.h:66
Int32 GetPointCount(void) const
Definition: c4d_baseobject.h:1460
static CAWeightTag * Alloc()
Definition: lib_ca.h:192
void SetMg(const Matrix &m)
Definition: c4d_baseobject.h:488
maxon::Float32 Float32
Definition: ge_sys_math.h:68
Definition: c4d_basetag.h:46
ResultMem Resize(Int newCnt, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::DEFAULT)
Definition: basearray.h:1124
Int32 GetCount() const
Definition: c4d_baselist.h:1649
const MAXON_ATTRIBUTE_FORCE_INLINE T * GetFirst() const
Definition: basearray.h:1081
#define iferr_return
Definition: resultbase.h:1465
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
BaseTag * GetActiveTag(void)
Definition: basearray.h:411
BaseObject * GetJoint(Int32 index, BaseDocument *doc)
void CalculateBoneStates(Int32 index)
JointRestState GetJointRestState(Int32 index)
static String IntToString(Int32 v)
Definition: c4d_string.h:495
#define NOTOK
Definition: ge_sys_math.h:267
void GetActiveObjects(AtomArray &selection, GETACTIVEOBJECTFLAGS flags) const
Definition: c4d_baselist.h:1361
maxon::Int32 Int32
Definition: ge_sys_math.h:60
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:210
void SetJointRestState(Int32 index, const JointRestState &state)
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:145
V off
The translation vector.
Definition: matrix.h:279
Definition: ge_autoptr.h:36
@ CHILDREN
Child objects are added to the selection too, provided they are selected. Otherwise only the topmost ...
Int32 GetWeightCount(Int32 index)
Bool IsInstanceOf(Int32 id) const
Definition: c4d_baselist.h:1403
String GetName() const
Definition: c4d_baselist.h:2348
Matrix m_oMg
Global matrix of the actual Joint object.
Definition: lib_ca.h:116
void InsertTag(BaseTag *tp, BaseTag *pred=nullptr)
#define Ojoint
Joint.
Definition: ge_prepass.h:1061
C4DAtom * GetIndex(Int32 idx) const
Definition: c4d_baselist.h:1664