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

    Which message do I receive when a command plugin dialog is closed?

    Cinema 4D SDK
    python r19
    3
    4
    1.1k
    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.
    • P
      pim
      last edited by

      I have a command plugin with a dialog.
      Which message do I receive when I close this dialog?

      This is how I checked for a close dialog.

      class MyDialog(gui.GeDialog):
      
          def Message(self, msg, result):  
              id = msg.GetId()
              #print "id: ", id
              if (id == c4d.C4DPL_END): 
                 print "Plugin closed."
              return gui.GeDialog.Message(self, msg, result)   
      
      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by mp5gosu

        You can simply implement AskClose(): https://developers.maxon.net/docs/py/2023_2/modules/c4d.gui/GeDialog/index.html?highlight=askclose#GeDialog.AskClose

        Or even DestroyWindow() etc.

        1 Reply Last reply Reply Quote 3
        • S
          s_bach
          last edited by

          Hello,

          as @mp5gosu has pointed out you can implement AskClose() and DestroyWindow() to be informed on these events.

          You find an example for AskClose() in Py-TextureBaker.pyp.

          You also find general information on GeDialog in the C++ documentation:

          • GeDialog Based Classes

          best wishes,
          Sebastian

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 2
          • P
            pim
            last edited by

            @s_bach said in Which message do I receive when a command plugin dialog is closed?:

            DestroyWindow

            Thanks.
            By the way, compliments on the latest R20 C++ manual. It is great!

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