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

    Remove Stray ShowPopUpDialog?

    Cinema 4D SDK
    r21 python
    2
    8
    831
    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.
    • B
      bentraje
      last edited by

      Hi,

      I have GeDialog that calls for a ShowPopupDialog and in turns call another GeDialog.
      It works but the problem is it has this stray show pop up dialog.
      I can exit through it with several clicks but it comes mildly annoying.

      Is there a way to force close it? Much the same way with GeDialog.Close()?

      You can check the problem here:
      https://www.dropbox.com/s/evgmizzcs205oyv/c4d210_stray_pop_up_dialog.mp4?dl=0

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @bentraje can you share your code?

        I will say it really probably that you call ShowPopupDialog on any BFM_INPUT event and not to an enough specific one.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • M
          m_adam
          last edited by

          Any update on this?

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 0
          • B
            bentraje
            last edited by

            Hi @m_adam

            Thanks for the response. I'll get back to you as soon as I can. The problem is part of a larger code base and I'm having a bit of problem on trimming it down.

            1 Reply Last reply Reply Quote 0
            • M
              m_adam
              last edited by

              Can I consider it closed?

              Without more information from your side, I will set the topic as solved at the end of the week.

              Cheers,
              Maxime

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

              1 Reply Last reply Reply Quote 0
              • B
                bentraje
                last edited by

                Hi @m_adam,

                Apologies for neglecting this one.

                RE: I will say it really probably that you call ShowPopupDialog on any BFM_INPUT event and not to an enough specific one.

                I had this part as a code base. So in a way I'm using the MOUSE_RIGHT as a filter and not necessarily as any input.

                            self.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSERIGHT, state)
                
                            if state.GetInt32(c4d.BFM_INPUT_VALUE) == True:
                                        popup_result = self.rename_cmd_popup_menu()
                

                You can check the illustration file here:
                https://www.dropbox.com/s/2xhmn4ia75f0lit/c4d210_stray_pop_up_dialog02.zip?dl=0

                Thank you for looking at the file. Apologies again for the trouble.

                1 Reply Last reply Reply Quote 0
                • M
                  m_adam
                  last edited by m_adam

                  Hi this is the same issue than Disable default Right-Click Menu.

                  So typically if you display a PopupDialog you have to not forward the event so to do that, call GeDialog.KillEvent before the popup dialog is open, then instead of forwarding the message with return c4d.gui.GeDialog.Message(self, msg, result)``simply return True`.

                  This gave us in rename_cmd_popup_menu

                  self.KillEvents()
                  result = gui.ShowPopupDialog(cd=None, bc=menu, x=c4d.MOUSEPOS, y=c4d.MOUSEPOS)
                  

                  in Message

                  popup_result = self.rename_cmd_popup_menu()
                  return True # after a PopupDialog is open don't forward the message.
                  

                  Cheers,
                  Maxime.

                  MAXON SDK Specialist

                  Development Blog, MAXON Registered Developer

                  1 Reply Last reply Reply Quote 1
                  • B
                    bentraje
                    last edited by

                    @m_adam

                    Thanks for the response (and the reference link)
                    Works as expected.

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