Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Deactivating custom tool

 Post Reply Post Reply
Author
Message
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 89
Post Options Post Options   Quote rsodre Quote  Post ReplyReply Direct Link To This Post Topic: Deactivating custom tool
    Posted: 2018 Jul 25 at 5:55pm

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?


Edited by rsodre - 2018 Jul 26 at 7:20am
Back to Top
knickknack View Drop Down
Forum Moderator
Forum Moderator


Joined: 2016 Jul 01
Location: Italy
Online Status: Offline
Posts: 261
Post Options Post Options   Quote knickknack Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Jul 26 at 3:04am
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() to verify difference with the last activated tool.

Best, Riccardo
MAXON Computer GmbH
SDK Support Team
Back to Top
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 89
Post Options Post Options   Quote rsodre Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Jul 26 at 7:19am
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?
Back to Top
knickknack View Drop Down
Forum Moderator
Forum Moderator


Joined: 2016 Jul 01
Location: Italy
Online Status: Offline
Posts: 261
Post Options Post Options   Quote knickknack Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Jul 26 at 8:52am
Hi rsodre,  I confirm that there's nothing publicly exposed.

Best, Riccardo
MAXON Computer GmbH
SDK Support Team
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.