RuntimeError: illegal operation



  • 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



  • 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.

    >



  • 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.



  • 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.



  • 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


Log in to reply