blender/doc/python_api/examples/bpy.app.timers.3.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
284 B
Python
Raw Normal View History

"""
Run a Function n times every x seconds
--------------------------------------
"""
import bpy
counter = 0
2019-11-01 10:53:47 +11:00
def run_10_times():
global counter
counter += 1
print(counter)
if counter == 10:
return None
return 0.1
2019-11-01 10:53:47 +11:00
bpy.app.timers.register(run_10_times)