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

    Threading in c4d

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 484 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 27/04/2011 at 06:12, xxxxxxxx wrote:

      Hi.

      It seems like threading does not work in cinema 4d. Is this right or am I doing something wrong ?
      Cinema 4D still stops doing anything until the thread has finished.

        
      from threading import Thread  
      from time import sleep  
        
      class mythread(Thread) :  
        def __init__(self) :  
            Thread.__init__(self)  
        
        def run(self) :  
            print "started"  
            sleep(10)  
            print "finished"  
        
      t = mythread()  
      t.start(); t.join()  
      

      for scriptmanager

      Calling a Process from the multiprocessing module does even raise an error.

      Thanks, nux

      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 27/04/2011 at 12:35, xxxxxxxx wrote:

        The script manager executes the Python script in the main thread.
        That means it sure blocks C4D until t.join() returns.You can use
        one or more custom threads in scripts but they all need to be finished
        at the end of the script. Threads in Plugins do offer more advantages here.

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