Deactivating custom tool
On 25/07/2018 at 17:55, xxxxxxxx wrote:
Cinema 4D Version: R19
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
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?
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() to verify difference with the last activated tool.
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?
On 26/07/2018 at 08:52, xxxxxxxx wrote:
Hi rsodre, I confirm that there's nothing publicly exposed.