On 14/01/2013 at 07:40, xxxxxxxx wrote:
I'm currently working on a script, that executes a function from a C++ Python extension inside a loop. I didn't write that extension and have no access to the sourcecode whatsoever.
My script goes something like this:
for i in xrange(10) : print "Currently rendering superslow function nr. ",i superslow.function(i) # Runs for a couple of seconds
The function involves some heavy rendering, so it is pretty slow. The problem I'm having, is that C4D freezes up after the first couple of iterations and not even the print statement is evaluated until the script is completely finished.
This has a couple of bad side effects, namely Windows recognizing Cinema 4D as unresponsive (If I click somewhere it asks if I want to close the application) and a lack of feedback on the current progress of the script.
While I understand the unresponsiveness of the application during the processing of the function, I don't really get, why the print statements are not evaluated after each function is finished.
Is there something like a "wakeup call" for Cinema that basically tells it to first give the system a sign of life, before it plunges into the next heavy calculation or would calling the function from a thread solve my problem?
Thanks for your help!