Hi,
The script you posted does work with for instance the Live Selection tool but does not work with Move/Scale/Rotate tools.
The following script changes the MDATA_AXIS_MODE
to MDATA_AXIS_MODE_FREE
for any active tool:
import c4d
from c4d import plugins
def SetToolData(doc, toolID, paramID, data):
plug = plugins.FindPlugin(toolID, c4d.PLUGINTYPE_TOOL)
if plug is None:
return
plug[paramID] = data
def main():
SetToolData(doc, doc.GetAction(), c4d.MDATA_AXIS_MODE, c4d.MDATA_AXIS_MODE_FREE)
c4d.EventAdd()
if __name__=='__main__':
main()
The above script does not use GetActiveToolData()
. It retrieves the object for the active tool (with FindPlugin()
) and sets the parameter (with operator []
).
For some technical reason, several tools need their settings to be changed via parameters and not accessing the tool data container directly.
Best regards,
Yannick