On 15/10/2016 at 17:29, xxxxxxxx wrote:
Hi everyone.
I'm trying to create timer that runs a function twice a second.
Here's the code of my plugin:
import c4d
from c4d import plugins
PLUGIN_ID=123454321
class MyMsg(c4d.plugins.MessageData) :
def GetTimer(self) :
return 500
def CoreMessage(self, id, bc) :
if id==PLUGIN_ID:
MyFunction()
return True
def MyFunction() :
print "tick"
if __name__=="__main__":
plugins.RegisterMessagePlugin(PLUGIN_ID, "TestPlugin", 0, MyMsg())
I can't figure out how to create and handle timer event. Is it possible? What am I doing wrong.
Would appreciate any help.
Have a nice day.