Timer in Maya to run a function every x seconds?

Timer in Maya to run a function every x seconds?

j.victor.ferreira
Enthusiast Enthusiast
962 Views
2 Replies
Message 1 of 3

Timer in Maya to run a function every x seconds?

j.victor.ferreira
Enthusiast
Enthusiast

Hi there!

Sorry for the basic question. I am trying to find a way to run a function every x seconds, Iv tried to find a MTimer or QTimer way to do but didnt have success.

I wanted to run the function when open a simple cmds.window() and stop the function when closes this window.

Somebody knows how to do that?

thanks in advance!

0 Likes
Accepted solutions (1)
963 Views
2 Replies
Replies (2)
Message 2 of 3

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

Since you are working in Python, you could just use the threading library to keep track of time.

 

https://docs.python.org/3/library/threading.html#timer-objects

 

I hope it helps!

Message 3 of 3

j.victor.ferreira
Enthusiast
Enthusiast
thanksss!
0 Likes