Hi,
I'm struggling with c4d.modules.character.CAWeightMgr for quite some time now. Unfortunately I couldn't find any example how to access the weight manager using python.
I tried to adapt the mini example in the C++ docs (https://developers.maxon.net/docs/Cinema4DCPPSDK/html/page_manual_caweigthmgr.html) but even this didn't work:
CAWeightMgr::SetParameter(doc, ID_CA_WEIGHT_MGR_AUTOWEIGHT_MODE, ID_CA_WEIGHT_MGR_AUTOWEIGHT_MODE_VISIBLE);
CAWeightMgr::SetParameter(doc, ID_CA_WEIGHT_MGR_AUTOWEIGHT_VISIBILITY_RATIO, 1.0);
CAWeightMgr::AutoWeight(doc, false);
... would be in python:
wmgr = c4d.modules.character.CAWeightMgr
wmgr.SetParameter(doc,c4d.ID_CA_WEIGHT_MGR_AUTOWEIGHT_MODE,c4d.ID_CA_WEIGHT_MGR_AUTOWEIGHT_MODE_VISIBLE)
wmgr.SetParameter(doc,c4d.ID_CA_WEIGHT_MGR_AUTOWEIGHT_VISIBILITY_RATIO,1.0)
c4d.EventAdd()
wasSuccessfull = wmgr.AutoWeight(doc,False)
print wasSuccessfull
Parameter were set correctly (and UI was also updated properly) but the actual FunctionCall "AutoWeight" failed. And this goes on with almost all other functions :-(
The only functions that work (at least for me) were selecting und unselecting joints in the weight manager.
CAWeightMgr.NormalizeWeights()
CAWeightMgr.ClearWeights()
CAWeightMgr.AutoWeight()
CAWeightMgr.MirrorWeights()
CAWeightMgr.BakeWeights()
CAWeightMgr.CopyWeights()
CAWeightMgr.PasteWeights()
CAWeightMgr.FlipWeights()
CAWeightMgr.SmoothWeights()
CAWeightMgr.ApplyWeightFunction()
... return code of the above functions is always False :-(
Would be great when a detailed example of using one of these functions could be posted.
cheers,
Jens