forked from bartvdbraak/blender
Docs: use float in bpy.app.timer examples
Makes it clear seconds are not integers, also avoids conversion to float.
This commit is contained in:
parent
e9875fc82c
commit
0ed4cadf5a
@ -6,6 +6,6 @@ import bpy
|
||||
|
||||
def every_2_seconds():
|
||||
print("Hello World")
|
||||
return 2
|
||||
return 2.0
|
||||
|
||||
bpy.app.timers.register(every_2_seconds)
|
||||
|
@ -8,5 +8,5 @@ import functools
|
||||
def print_message(message):
|
||||
print("Message:", message)
|
||||
|
||||
bpy.app.timers.register(functools.partial(print_message, "Hello"), first_interval=2)
|
||||
bpy.app.timers.register(functools.partial(print_message, "World"), first_interval=3)
|
||||
bpy.app.timers.register(functools.partial(print_message, "Hello"), first_interval=2.0)
|
||||
bpy.app.timers.register(functools.partial(print_message, "World"), first_interval=3.0)
|
||||
|
@ -20,6 +20,6 @@ def execute_queued_functions():
|
||||
while not execution_queue.empty():
|
||||
function = execution_queue.get()
|
||||
function()
|
||||
return 1
|
||||
return 1.0
|
||||
|
||||
bpy.app.timers.register(execute_queued_functions)
|
||||
|
Loading…
Reference in New Issue
Block a user