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

    GeDialog.AskClose Method Problem

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 597 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 15/11/2012 at 22:53, xxxxxxxx wrote:

      Hello!

      I'm implementing the AskClose() method in a CommandData plugin and everything is working as expected. If I close the dialog window for the plugin, the method gets called and it does its job.

      The problem I'm experiencing however, is that if you quit C4D from either the file->quit menu or just command + q (mac) while the plugin window is open, C4D crashes. Removing the AskClose() method solves the issue so it seems that this is where the problem stems from.  It makes sense because once the dialog is gone, there is no AskClose method to call. At least that is my thinking. Even just having the method as a stubb with pass in it crashes the app.

      Is there a way to detect when C4D is about to close and avoid calling the method? I tried using c4d.BFM_DESTROY in Message but could not get it to work. I'm at a loss on how to solve this.

      Thanks!

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 16/11/2012 at 02:29, xxxxxxxx wrote:

        Hi,

        This is a known issue with GeDialog.AskClose().

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 16/11/2012 at 18:43, xxxxxxxx wrote:

          Thanks for the info Yannick!

          Also, does GeDialog.Message() suffer from the same issue when used in a CommandData plugin?

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 19/11/2012 at 02:47, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            Also, does GeDialog.Message() suffer from the same issue when used in a CommandData plugin?

            No, here's how you can filter BFM_DESTROY in a dialog's Message() method:

            def Message(self, msg, result) :
                if msg.GetId()==c4d.BFM_DESTROY:
                    print "Dialog to be destroyed"
                return GeDialog.Message(self, msg, result)
            

            As you can see, we have to get the message ID from the container's ID.
            Also, be sure to call GeDialog.Message() implementation as last return otherwise your dialog won't work as expected.

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 21/11/2012 at 16:38, xxxxxxxx wrote:

              Thanks again for your help Yannick!

              I've tried this code and various other methods but Cinema still crashes when using file->quit or using the quit shortcut while the plugin window is visible.

              I've stripped down the plugin to the bare minimum to determine the cause of the issue but it is only resolved when I don't implement GeDialog.Message()

              The method works as expected while the plugin is operating and if I close the plugin window first then close Cinema, everything is fine.

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

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 22/11/2012 at 00:00, xxxxxxxx wrote:

                Originally posted by xxxxxxxx

                I've tried this code and various other methods but Cinema still crashes when using file->quit or using the quit shortcut while the plugin window is visible.

                I've stripped down the plugin to the bare minimum to determine the cause of the issue but it is only resolved when I don't implement GeDialog.Message()

                Yes, you're right. There's a similar known issue with GeDialog.Message().

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

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 22/11/2012 at 00:25, xxxxxxxx wrote:

                  Thanks Yannick! I appreciate you taking the time to look into this.

                  I thought I was going crazy! 😉

                  Not a deal breaker. Everything else works good. I just thought it was something I was doing wrong.

                  Thanks again! 🙂

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