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.
{
if (joint == nullptr)
}
Py_ssize_t i
Definition: abstract.h:645
String GetName() const
Definition: c4d_baselist.h:2544
Definition: c4d_baseobject.h:248
Definition: c4d_basetag.h:52
Bool IsInstanceOf(Int32 id) const
Definition: c4d_baselist.h:1562
Int32 GetJointCount() const
BaseObject * GetJoint(Int32 index, BaseDocument *doc)
maxon::Int32 Int32
Definition: ge_sys_math.h:56
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
#define Tweights
Weights.
Definition: ge_prepass.h:1452
const char * doc
Definition: pyerrors.h:226
Allocation/Deallocation
CAWeightTag instances are created with the usual tools, see Entity Creation and Destruction Manual (Classic).
if (weightTag == nullptr)
polygonObject->InsertTag(weightTag);
static CAWeightTag * Alloc()
Definition: lib_ca.h:192
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)
const Int32 objectCount = objects->GetCount();
{
if (baseObject == nullptr)
{
}
}
Definition: ge_autoptr.h:37
Definition: c4d_baselist.h:1521
Int32 AddJoint(BaseObject *op)
#define atom
Definition: graminit.h:72
@ CHILDREN
Child objects are added to the selection too, provided they are selected. Otherwise only the topmost ...
#define Ojoint
Joint.
Definition: ge_prepass.h:1097
For each joint the reset (or rest) state is stored:
The JointRestState structure has these members:
{
}
JointRestState GetJointRestState(Int32 index) const
static String FloatToString(Float32 v, Int32 vvk=-1, Int32 nnk=-3)
Definition: c4d_string.h:531
maxon::Float Float
Definition: ge_sys_math.h:62
PyWideStringList Py_ssize_t length
Definition: initconfig.h:448
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;
const Int32 pointCount = polyObject->GetPointCount();
for (
Int32 weightIndex = 0; weightIndex < pointCount; ++weightIndex)
{
const Float32 weight = weights[weightIndex];
}
Int32 GetWeightCount(Int32 index) const
void GetWeightMap(Int32 index, Float32 *map, Int32 cnt, Bool includeEffectors=false) const
Definition: basearray.h:415
MAXON_ATTRIBUTE_FORCE_INLINE const T * GetFirst() const
Definition: basearray.h:1175
ResultMem Resize(Int newCnt, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::DEFAULT)
Definition: basearray.h:1218
maxon::Float32 Float32
Definition: ge_sys_math.h:64
#define iferr_return
Definition: resultbase.h:1524
const Int32 pointCount = polyObject->GetPointCount();
for (
Int32 pointIndex = 0; pointIndex < pointCount; ++pointIndex)
{
}
Float GetWeight(Int32 index, Int32 pntindex) const
static String IntToString(Int32 v)
Definition: c4d_string.h:497
Matrix
Functions
CAWeightTag offers these functions:
if (joint)
void SetMg(const Matrix &m)
Definition: c4d_baseobject.h:516
void CalculateBoneStates(Int32 index)
void SetJointRestState(Int32 index, const JointRestState &state)
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:141
#define NOTOK
Definition: ge_sys_math.h:263
Further Reading