Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi,
I'm currently porting a COFFEE script to Python and it seems that accessing/updating tool settings is much more complicated in Python than COFFEE.
I initially tried something like:
active_tool = doc.GetActiveToolData() active_tool[c4d.MDATA_AXIS_MODE] == 8 # Free Axis Mode c4d.EventAdd()
But it had no effect. I eventually found my way to this post which led me to a solution like this:
def tool(): """Retrieves the currently active tool. Doing so allows you to modify tool settings unlike GetActiveToolData()""" active_tool_id = doc.GetAction() if not active_tool_id: return active_tool = c4d.plugins.FindPlugin(active_tool_id, c4d.PLUGINTYPE_TOOL) return active_tool def main(): """Switch from Free Mode to Axis mode and vice/versa. """ active_tool = tool() if active_tool is None: return active_tool[c4d.MDATA_AXIS_MODE] == 8 # Free Axis Mode c4d.EventAdd()
ActiveToolData()
tool()
Thank you,
Donovan Keith
Hello,
which tool do you actually want to configure?
best wishes, Sebastian