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

20 lines
284 B
Python
Raw Normal View History

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