c4d.modules.character.CAWeightTag

Inheritance

Members

CAWeightTag.__init__()
Return type:c4d.modules.character.CAWeightTag
Returns:The new weight tag.
CAWeightTag.GetJoint(index, doc=None)

Get joint object at index.

Parameters:
CAWeightTag.GetJointCount()

Get total joint count.

Return type:int
Returns:Total joint count.
CAWeightTag.FindJoint(op, doc=None)

Return the index of this object or NOTOK if not found.

Parameters:
CAWeightTag.GetJointRestState(index)

Get the rest state for the joint at index.

Parameters:index (int) – The index of the joint.
Raises:IndexError – If the joint index is out of range : 0<=index<GetJointCount().
Return type:dict{m_bMg: c4d.Matrix, m_bMi: c4d.Matrix, m_oMg: c4d.Matrix, m_oMi: c4d.Matrix}
Returns:The state.
CAWeightTag.SetJointRestState(index, m_bMg, m_bMi, m_oMg, m_oMi, m_Len)

Set the rest state for the joint at index.

Parameters:
  • index (int) – The index of the joint.
  • m_bMg (c4d.Matrix) – Joint global matrix.
  • m_bMi (c4d.Matrix) – Joint inverse matrix.
  • m_oMg (c4d.Matrix) – Object global matrix.
  • m_oMi (c4d.Matrix) – Object inverse matrix.
  • m_Len (float) – Length.
CAWeightTag.GetWeightCount(index)

Gets the total number of stored weights for the given joint index.

Parameters:index (int) – Joint index.
Return type:int
Returns:The number of weights. 0 means weights are not stored.
CAWeightTag.GetIndexWeight(index, windex)

Get the windex weight and which point index pntindex it is as well as the weight

pntindex, weight = caweighttag.GetIndexWeight(0, 0)
Parameters:
  • index (int) – Joint index.
  • windex (int) – Weight index.
Return type:

Tuple[int, int]

Returns:

Returns the point index, and the corresponding weight.

CAWeightTag.GetWeight(index, pntindex)

Return the weight for the point pntindex.

Parameters:
  • index (int) – Joint index.
  • pntindex (int) – Point index.
Return type:

float

Returns:

Weight.

CAWeightTag.SetWeight(index, pntindex, weight)

Set the weight for pntindex.

Parameters:
  • index (int) – Joint index.
  • pntindex (int) – Point index.
  • weight (float) – New weight.
Return type:

bool

Returns:

True if successful, otherwise False.

CAWeightTag.GetWeightDirty()

Get the dirty state of the weights.

Return type:long
Returns:The weight’s dirty state.
CAWeightTag.WeightDirty()

Marks the weights dirty.

CAWeightTag.GetGeomMg()

Get the global matrix for the bind geometry. Use this with the global matrices of the joints to get the local transforms.

Return type:c4d.Matrix
Returns:The global matrix for the bind geometry.
CAWeightTag.SetGeomMg(mg)

Set the global matrix for the bind geometry.

Parameters:mg (c4d.Matrix) – The global matrix for the bind geometry.
CAWeightTag.AddJoint(op)

Add a Joint object to the Weight tag’s “Joints” list.

Parameters:op (c4d.BaseObject) – The Joint object to add to the Weight tag’s “Joints” list.
Return type:int
Returns:Joint object’s index in the “Joints” list.
CAWeightTag.RemoveJoint(op)

Remove Joint object from the Weight tag’s “Joints” list.

Parameters:op (c4d.BaseObject) – The Joint object to remove from the Weight tag’s “Joint” list.
CAWeightTag.CalculateBoneStates(index)

Helper function to initialize the Joint at index.

Note

The Joints must be in the document.

Parameters:index (int) – The Joint index. Set to NOTOK to process all joints.
CAWeightTag.TransferWeightMap(doc, dst, sindex, dindex, offset, cnt)

Transfer the weights from one Weight tag to another. Pass NOTOK for sindex, dindex and cnt if they shouldn’t be evaluated.

Parameters:
  • doc (c4d.documents.BaseDocument) – The document containing the Weight tags.
  • dst (c4d.modules.character.CAWeightTag) – The destination Weight tag.
  • sindex (int) – Index of the source Joint.
  • dindex (int) – Index of the destination Joint.
  • offset (int) – Offset to move the weight indices when they are copied to the destination.
  • cnt (int) – Number of weights to be transfered.