This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com

c4d.modules.character.CAWeightTag – a weight tag class

class c4d.modules.character.CAWeightTag

SuperClass

BaseTag

Methods

CAWeightTag.__init__()
Return type:CAWeightTag
Returns:The new weight tag.
CAWeightTag.GetJoint(index, doc)

Get joint object at index.

Parameters:
  • index (int) – The joint index.
  • doc (BaseDocument) – Document or None.
CAWeightTag.GetJointCount()

Get total joint count.

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

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

Parameters:
  • op (BaseObject) – Host object.
  • doc (BaseDocument) – Document or None.
CAWeightTag.GetJointResState(index)

Get the rest state for the joint at index.

Parameters:
  • m_bMgMatrix
  • m_bMg – Joint global matrix.
  • m_bMiMatrix
  • m_bMi – Joint inverse matrix.
  • m_oMgMatrix
  • m_oMg – Object global matrix.
  • m_oMiMatrix
  • m_oMi – Object inverse matrix.
  • m_Len – float
  • m_Len – Length
Return type:

dict

CAWeightTag.SetJointResState(index, m_bMg, m_bMi, m_oMg, m_oMi, m_Len)

Set the rest state for the joint at index.

Parameters:
  • m_bMg (Matrix) – Joint global matrix.
  • m_bMi (Matrix) – Joint inverse matrix.
  • m_oMg (Matrix) – Object global matrix.
  • m_oMi (Matrix) – Object inverse matrix.
  • m_Len (float) – Length.
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:

list

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 succesful, 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:Matrix
Returns:The global matrix for the bind geometry.
CAWeightTag.SetGeomMg(mg)

Set the global matrix for the bind geometry.

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

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

Parameter:op (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.

Parameter:op (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.

Parameter: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 (BaseDocument) – The document containing the Weight tags.
  • dst (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.

Table Of Contents

This Page