bpy.app.timers.3.py 282 B

123456789101112131415161718
  1. """
  2. Run a Function n times every x seconds
  3. --------------------------------------
  4. """
  5. import bpy
  6. counter = 0
  7. def run_10_times():
  8. global counter
  9. counter += 1
  10. print(counter)
  11. if counter == 10:
  12. return None
  13. return 0.1
  14. bpy.app.timers.register(run_10_times)