I want to periodically run a function in a way similar to what
Timer but I was getting multithreading errors since the function tries to access a TouchDesigner object (it seems we can’t do that).
I finally got it working by using
run() but it feels very clunky. I have defined this function (which calls itself every second):
def doStuff(): myOp = args # do stuff with myOp run("doStuff()", myOp, delayFrames = 60, fromOP = me)
To start the process, I must first call the function like this:
run("doStuff()", myOperator, delayFrames = 60, fromOP = me)
Is there a better way to do it? Is there anything similar to
setInterval() that would work inside TouchDesigner ?