Python API Docs: Examples for new timer api

This commit is contained in:
2018-11-27 11:31:35 +01:00
parent 39dcf6a10a
commit dcb86689b0
5 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
"""
Run a Function n times every x seconds
--------------------------------------
"""
import bpy
counter = 0
def run_10_times():
global counter
counter += 1
print(counter)
if counter == 10:
return None
return 0.1
bpy.app.timers.register(run_10_times)