[Bf-blender-cvs] [0ed4cadf5ad] blender2.8: Docs: use float in bpy.app.timer examples

Campbell Barton noreply at git.blender.org
Tue Nov 27 20:31:25 CET 2018


Commit: 0ed4cadf5ad065a624c6e93d00631cec54315302
Author: Campbell Barton
Date:   Wed Nov 28 06:09:42 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB0ed4cadf5ad065a624c6e93d00631cec54315302

Docs: use float in bpy.app.timer examples

Makes it clear seconds are not integers,
also avoids conversion to float.

===================================================================

M	doc/python_api/examples/bpy.app.timers.2.py
M	doc/python_api/examples/bpy.app.timers.4.py
M	doc/python_api/examples/bpy.app.timers.5.py

===================================================================

diff --git a/doc/python_api/examples/bpy.app.timers.2.py b/doc/python_api/examples/bpy.app.timers.2.py
index cdd9bf8e9ff..c663959c209 100644
--- a/doc/python_api/examples/bpy.app.timers.2.py
+++ b/doc/python_api/examples/bpy.app.timers.2.py
@@ -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)
diff --git a/doc/python_api/examples/bpy.app.timers.4.py b/doc/python_api/examples/bpy.app.timers.4.py
index a56d0e5f36f..6cdee564bb5 100644
--- a/doc/python_api/examples/bpy.app.timers.4.py
+++ b/doc/python_api/examples/bpy.app.timers.4.py
@@ -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)
diff --git a/doc/python_api/examples/bpy.app.timers.5.py b/doc/python_api/examples/bpy.app.timers.5.py
index b35e307f218..821a047d7c7 100644
--- a/doc/python_api/examples/bpy.app.timers.5.py
+++ b/doc/python_api/examples/bpy.app.timers.5.py
@@ -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)



More information about the Bf-blender-cvs mailing list