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

    Deactivating custom tool

    SDK Help
    0
    4
    1.0k
    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.
    • H
      Helper
      last edited by

      On 25/07/2018 at 17:55, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R19 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hi,

      We use doc->SetAction( TOOL_ID ) to activate a custom tool, but what's the best method to deactivate it when we're done?

      I guess to load the previous one from the last tools list, but I can't find any way to access that list.

      Is the only way by listening to EVMSG_TOOLCHANGED to remember what was there before?

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 26/07/2018 at 03:04, xxxxxxxx wrote:

        Hi rsodre, thanks for writing us.

        With regard to your question, actually there's no method to "deactivate" a tool, because it's simply not the way a tool was designed (actually a tool is no more active only when another tool is activated).

        What you can attempt is to catch up with a EVMSG_TOOLCHANGED message being dispatched and query the active tool via BaseDocument::GetAction()[URL-REMOVED] to verify difference with the last activated tool.

        Best, Riccardo


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 26/07/2018 at 07:19, xxxxxxxx wrote:

          Yeah, that's what I'm doing.

          So I guess there's no way to access the previous tool stack we have on the toolbar?

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 26/07/2018 at 08:52, xxxxxxxx wrote:

            Hi rsodre,  I confirm that there's nothing publicly exposed.

            Best, Riccardo

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