Quite a while ago I had brought up the idea to parse the description of an active tool (like i.e. the Extrude tool).
The information provided in that topic was really helpful.
But now I am wondering how to to find out if this MDATA_APPLY button is disabled.
I have digged somewhat deeper in available discussions and examples, and it seems I don't really need to know the state of the MDATA_APPLY button ... but I am still curious how one would proceed to find out when that button is grayed out or not.
the simplest way is probably to use the GetEnabling function. I see no drawback of using it
Unfortunately, this function isn't available in python. But you tag this thread with c++
The other way of doing it would be, as you said, to parse the description of an active tool.
Int32 active_tool_id = doc->GetAction();
BasePlugin* baseTool = FindPlugin(active_tool_id, PLUGINTYPE::TOOL);
Bool isActive = baseTool->GetEnabling(DescID(MDATA_APPLY), data, DESCFLAGS_ENABLE::NONE, nullptr);
ApplicationOutput("the apply button is active");
ApplicationOutput("the apply button is NOT active");
I knew about GetEnabling as part of the functions needed to be implemented for nodebase-derived objects, in order to let Cinema4D visualize the state of the attribute.
But never realized we could call these from within a plugin to actually get the state.
Sometimes easy concepts are just lost on me.
one side note, there is GetDEnabling and GetEnabling you can have more information in our manual
GetEnabling will call GetDEnabling.
There are pretty the same but the one you implement is GetDEnabling.