Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

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

    Cinema 4D SDK
    r20 c++
    2
    4
    644
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C4DSC
      C4DS
      last edited by C4DS

      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://developers.maxon.net/forum/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.

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by Manuel

        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

        MAXON SDK Specialist

        MAXON Registered Developer

        C4DSC 1 Reply Last reply Reply Quote 1
        • C4DSC
          C4DS @Manuel
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            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.

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 1
            • First post
              Last post