For a particular setup in R23/24, I’m trying to restrict the auto weighting to 1 joint - to avoid blending between weights (which will save me trouble down the line..).
Since R21 the “ID_CA_WEIGHT_MGR_AUTOWEIGHT_JOINTS” is removed so I can’t set it directly (see the simplified code below).
I tried to figure out a workaround, with no luck. My thought was that if I could read the autoweightDictonary, I could also set it.
The function “GetAutoWeightDictionary” needs a stringId (which is a maxon.Id, but that didn’t help me any further..)
So, the main question: How can I set the amount of Joints (to 1) when autoweighting?
And of course I don’t mean mannualy :} tia, Jochem
import c4d, maxon
def message(id, data):
if id == c4d.MSG_DESCRIPTION_COMMAND:
id2 = data['id'][0].id
if id2 == c4d.ID_USERDATA:
userDataId = data['id'][1].id
if userDataId == 1:
accessWM()
c4d.EventAdd()
def accessWM():
doc = op.GetDocument()
for tag in op.GetObject().GetTags():
if tag.GetType() == 1019365: wTag = tag
doc.SetActiveTag(wTag, c4d.SELECTION_NEW)
wmgr = c4d.modules.character.CAWeightMgr
wmgr.SetParameter(doc,c4d.ID_CA_WEIGHT_MGR_AUTOWEIGHT_MODE,1) # heatmap
wmgr.SetParameter(doc,c4d.ID_CA_WEIGHT_MGR_AUTOWEIGHT_IN_BIND_POSE,True)
# ID_CA_WEIGHT_MGR_AUTOWEIGHT_JOINTS // removed since R21 :{
wmgr.AutoWeight(doc)
wmgr.Update(doc)
"""
hmmm1 = wmgr.GetAutoWeightDictionary(doc, maxon.Id("AutoWeight"))
hmmm2 = wmgr.GetAutoWeightDictionary(doc, maxon.Id)
print (hmmm1, type(hmmm1))
print (hmmm2, type(hmmm2))
# both print: <class 'maxon.reference.DataDictionary'>
"""
def main():
pass