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
    • Recent
    • Tags
    • Users
    • Login

    get an event when something is done [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 581 Views
    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 Offline
      Helper
      last edited by

      On 19/05/2015 at 03:20, xxxxxxxx wrote:

      Hi all,

      I'm working on a Modal Dialog Plungin.
      And I whant to change my Plugin-Dialog when a object or a Tag is selectet while the Dialog is open.
      I've found thomething in the SDK under "Continuous polling"
      But I dont know what and where to insert.

      I only need something like:

        
      def something_is_seleced_or_deseleckted(doc) :   
          something_is_done = False   
          # here is the dedection....   
          something_is_done = True   
          return something_is_done   
        
      if something_is_seleced_or_deseleckted(doc) :   
         self.update_status()   
      

      Thanks a lot

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

        On 19/05/2015 at 08:48, xxxxxxxx wrote:

        Hi Kissling,

        I did not find 'continuous polling' in the SDK.  In any case, modal dialogs are meant to block all other UI to inform the user with a message, usually with a warning or error, or to get needed input of some kind before it can continue, especially in terms of accepting other input from the dialog it spawned from.  Therefore, what you describe cannot be done with a modal dialog, whether with a messaging system or polling.

        To implement more or less what you describe, you must create a asynchronous (or modeless) dialog and make your main dialog send messages to it.  The asynchronous dialog will have to have message processing code to handle the updates.

        Let me know if you need more info.

        Joey Gaspe
        SDK Support Engineer

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

          On 19/05/2015 at 14:15, xxxxxxxx wrote:

          Hy Joey,

          in the C4D-SDK
          at the end of the page I found this:

          https://developers.maxon.net/docs/py/2023_2//help/misc/inputevents.html?highlight=continuous polling

            
          state=c4d.BaseContainer()   
          while gui.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, state) :   
              if state.GetInt32(c4d.BFM_INPUT_VALUE)==0: break   
            
              x=state.GetInt32(c4d.BFM_INPUT_X)   
              y=state.GetInt32(c4d.BFM_INPUT_Y)   
            
              #x, y   
          
          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 19/05/2015 at 16:15, xxxxxxxx wrote:

            You can't interact with anything but the dialog when using a modal dialog.

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

              On 20/05/2015 at 07:48, xxxxxxxx wrote:

              Hi Kissling,

              The continuous polling you pointed out is for modeless dialogs only. As I already stated and NiklasR also pointed out, a modal dialog cannot receive messages once it's created.  Please read the following Wikipedia page for an explanation of modal and modeless dialogs (the later ones are called asynchronous dialogs in the SDK) :
              http://en.wikipedia.org/wiki/Dialog_box

              Joey Gaspe
              SDK Support Engineer

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

                On 21/05/2015 at 11:20, xxxxxxxx wrote:

                Ok,
                i will beleve in you 🙂

                So I will change to non-modal-dialog!
                Thanks a lot.

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

                  On 21/05/2015 at 11:30, xxxxxxxx wrote:

                  Hi Kissling,

                  Thanks for replying! I'll flag this topic as closed but leave it open for any follow up questions.

                  Joey Gaspe
                  SDK Support Engineer

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