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

    RuntimeError: illegal operation

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 421 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 30/03/2012 at 05:43, xxxxxxxx wrote:

      File "'Python Generator'", line 32, in main
      RuntimeError: illegal operation, invalid cross-thread call

      def main() :
        myDialog = CustomDialog()
        myDialog.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE, PLUGIN_ID, 400, 300, defaultw=400, defaulth=700, subid=0) <--------------- this is line 32

      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 30/03/2012 at 11:36, xxxxxxxx wrote:

        not sure on this, but i guess you are using a threaded function in your code, which
        make this gui operation illegal.

        http://www.thirdpartyplugins.com/python/modules/c4d.threading/index.html

        For all threaded functions it's forbidden to:

        > 1. Add an Event.
        > 2. Make any changes to materials.
        > 3. Change the structure of objects attached to the scene.
        > 4. Change parameters of elements attached to the scene (allowed, but not recommended except for tags).
        > 5. Call a Draw function.
        > 6. Perform any GUI functionality (e.g. displaying messages, opening dialogs etc.).
        > 7. During drawing to do any file operations. (During execution t's allowed.)
        > 8. Create undos.

        >

        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 30/03/2012 at 13:18, xxxxxxxx wrote:

          A little more Information and maybe some words where you're asking for help would be kind. Why
          should we care to write you an answer if you don't care to write a comprehensive (spoken and visually) question?

          You can't do gui operations in Tags/Generators. Take a minute to think about it and you'll understand
          why not.

          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 30/03/2012 at 15:12, xxxxxxxx wrote:

            also scattering your questions over multiple threads makes it quite hard to follow your
            progress.

            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 31/03/2012 at 14:51, xxxxxxxx wrote:

              ok thanks. i usually start to program in python doing from c4d menu script, python and the i modify the default code or i do load script. maybe that create a tag python script but i've to do scripting in some other way so i can use the threader

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