THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2012 at 07:27, xxxxxxxx wrote:
i'm quite new to the topic of c4d-programming and i'm trying to figure out if it is possible to write a plugin/ script that lets me control cinema form a different python and and let these communicate through sockets. So when Cinema starts it should ask the other process why to do. I already saw that its possible to launch code on startup using the startupscript, but cinema doesn't completely start until the script is finished. So I think my code has to be executed as a plugin. Am I right? Is it possible to start a plugin on c4d-startup?? As i said I'm quite new to the topic and this thing is quite trivial. I appreciate your help.
On 02/06/2012 at 07:54, xxxxxxxx wrote:
just to clarify. i think what i want to ask is:
Is it possible to start a plugin on on c4d-startup and let it do stuff in the background??
On 02/06/2012 at 08:31, xxxxxxxx wrote:
Ok just got it to work using c4d.threading.C4DThread. Is this the way to go here??
On 02/06/2012 at 11:14, xxxxxxxx wrote:
you can either use c4d.threading.C4DThread or use the built-in threading module. Actually, I don't know if there are advantages on using the C4DThread.
Here's what you could do for example:
class MyThread(threading.Thread) :
def run(self) :
client = socket.socket()
# make stuff with the connection
def main() :
thread = MyThread()
if __name__ == "__main__":
Note that you can not make GUI operations in Cinema 4D from another thread.
On 04/06/2012 at 01:11, xxxxxxxx wrote:
Thank you Nik,
threading is better than C4DThread because it works with R12 too. Thanks for the note on Gui operations.