Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Call a ToolData plugin as modeling command

    SDK Help
    0
    3
    397
    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 21/02/2017 at 08:01, xxxxxxxx wrote:

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

      ---------
      Hello.

      I have a ToolData plugin.

      The following code returns false:

      ModelingCommandData cd;
      cd.doc = GetActiveDocument();
      if (!SendModelingCommand(MY_TOOLDATA_PLUGIN_ID, cd)) 
      	return false;
      

      I can see it as command in "Customize Commands" window and it works fine when I select it and click "Execute" there.

      Why does SendModelingCommand fails to call it ?

      Thank you.

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

        On 22/02/2017 at 01:36, xxxxxxxx wrote:

        Hello,

        using the "Customize Commands" dialog you are just enabling the tool. This can also be achieved using BaseDocument::SetAction() (see BaseDocument Manual).

        If you want to invoke the tool using SendModelingCommand() you have to implement ToolData::DoCommand() in your plugin class.

        best wishes,
        Sebastian

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

          On 17/03/2017 at 09:55, xxxxxxxx wrote:

          Hello peterakos,

          was your question answered?

          best wishes,
          Sebastian

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