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

    How to catch SubDialog errors?

    Cinema 4D SDK
    python
    2
    3
    408
    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.
    • mikeudinM
      mikeudin
      last edited by

      Hello guys!
      My plugin have to load some parts of its interface using methods AddSubDialog, AttachSubDialog. But if there is some errors or typos on gui subdialog class methods like InitValues():

      TypeError: InitValues() takes no arguments (1 given)

      is not "raiseble" with try/raise. Error just appears in Script Console.
      How to catch all gui drawing errors?

      Checkout my python tutorials, plugins, scripts, xpresso presets and more
      https://mikeudin.net

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by

        Hi @mikeudin, thanks for reaching out us.

        With regard to the chance to "catch all the GUI drawing errors", it's not possible being the involved methods called during the runtime by Cinema and the try/raise solution simply can't work.

        With regard to the cause of this error, I guess you're getting it cause you forgot to add the self parameter in your GeDialog::InitValues() implementation. Please check.

            def InitValues(self):
                print "called InitValues for my dialog"
                return True;
        

        Cheers, R

        1 Reply Last reply Reply Quote 1
        • mikeudinM
          mikeudin
          last edited by

          Thanks! So will find some workaround.

          Checkout my python tutorials, plugins, scripts, xpresso presets and more
          https://mikeudin.net

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