SOLVED How to know when Apply button is grayed out (disabled)

Quite a while ago I had brought up the idea to parse the description of an active tool (like i.e. the Extrude tool).
(see https://plugincafe.maxon.net/topic/11186/confusing-tooldata-content/18).

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.

EDIT:
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.

hi,

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);
	GeData data;
	Bool isActive = baseTool->GetEnabling(DescID(MDATA_APPLY), data, DESCFLAGS_ENABLE::NONE, nullptr);

	if (isActive)
		ApplicationOutput("the apply button is active");
	else
		ApplicationOutput("the apply button is NOT active");

	return maxon::OK;

Cheers,
Manuel

@m_magalhaes
Thanks!
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.

hi,

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.

Cheers,
Manuel.