THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/05/2012 at 08:07, xxxxxxxx wrote:
I've accessed the weights manager through Python. But I haven't had a chance to convert it to C++ yet. It's something I was planning on doing at some point.
The most important thing to know is that you have to have the weight brush tool open at the same time. Or none of your code will execute in the weight manager.
Here's a python example:
import c4d
def main() :
c4d.CallCommand(1019499) #Launch Weight Tool
c4d.CallCommand(1025028) #Launch Weights Manager
tool = doc.GetActiveToolData()
tool[c4d.ID_CA_WEIGHT_TOOL_WEIGHTS_HIDE_ZERO] = 0 #Sets this checkbox option to off
tool=doc.GetAction()
tool=c4d.plugins.FindPlugin(tool, c4d.PLUGINTYPE_TOOL)
#c4d.CallButton(tool, c4d.ID_CA_WEIGHT_TOOL_FN_CLEARWEIGHT) #Deletes the weighting on the selected joint
c4d.CallButton(tool, c4d.ID_CA_WEIGHT_TOOL_MIRROR) #Executes the Auto Mirror button
c4d.EventAdd()
if __name__=='__main__':
main()
For C++. The [] stuff needs to be converted to GetParameter()&SetParameter(). As well as the button codes.
If you do end up using this and converting it to C++. Please post an example in this thread.
That would save me the trouble of converting it myself.
P.S.- Here's the .h file resources: ..\..\..\..\resource\modules\ca\res\description oolcaweight.h
-ScottA