Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-07-06 05:05:27 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-07-06 05:05:27 +0300
commit432bfbf7a3b74943b1c251c12bd76616da23991f (patch)
tree4fff10c2aaca9d48ac4ccc1b368124ce102a53a1 /doc
parent36584bbc2d347cc1df9fd77b59ff1a3d3d7fef53 (diff)
Cleanup: pep8
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/examples/bpy.app.handlers.2.py1
-rw-r--r--doc/python_api/examples/bpy.app.timers.5.py2
-rw-r--r--doc/python_api/examples/bpy.msgbus.1.py2
-rw-r--r--doc/python_api/examples/bpy.types.Depsgraph.7.py2
-rw-r--r--doc/python_api/examples/gpu.6.py1
5 files changed, 7 insertions, 1 deletions
diff --git a/doc/python_api/examples/bpy.app.handlers.2.py b/doc/python_api/examples/bpy.app.handlers.2.py
index aaaedeabecb..d514fa3fa4b 100644
--- a/doc/python_api/examples/bpy.app.handlers.2.py
+++ b/doc/python_api/examples/bpy.app.handlers.2.py
@@ -12,6 +12,7 @@ such cases, lock the interface (Render → Lock Interface or
Below is an example of a mesh that is altered from a handler:
"""
+
def frame_change_pre(scene):
# A triangle that shifts in the z direction
zshift = scene.frame_current * 0.1
diff --git a/doc/python_api/examples/bpy.app.timers.5.py b/doc/python_api/examples/bpy.app.timers.5.py
index 821a047d7c7..dda5ea12e73 100644
--- a/doc/python_api/examples/bpy.app.timers.5.py
+++ b/doc/python_api/examples/bpy.app.timers.5.py
@@ -16,10 +16,12 @@ execution_queue = queue.Queue()
def run_in_main_thread(function):
execution_queue.put(function)
+
def execute_queued_functions():
while not execution_queue.empty():
function = execution_queue.get()
function()
return 1.0
+
bpy.app.timers.register(execute_queued_functions)
diff --git a/doc/python_api/examples/bpy.msgbus.1.py b/doc/python_api/examples/bpy.msgbus.1.py
index 21198471ffa..8164272d521 100644
--- a/doc/python_api/examples/bpy.msgbus.1.py
+++ b/doc/python_api/examples/bpy.msgbus.1.py
@@ -31,11 +31,13 @@ owner = object()
subscribe_to = bpy.context.object.location
+
def msgbus_callback(*args):
# This will print:
# Something changed! (1, 2, 3)
print("Something changed!", args)
+
bpy.msgbus.subscribe_rna(
key=subscribe_to,
owner=owner,
diff --git a/doc/python_api/examples/bpy.types.Depsgraph.7.py b/doc/python_api/examples/bpy.types.Depsgraph.7.py
index 11982730fc9..afea8dfd618 100644
--- a/doc/python_api/examples/bpy.types.Depsgraph.7.py
+++ b/doc/python_api/examples/bpy.types.Depsgraph.7.py
@@ -44,7 +44,7 @@ class OBJECT_OT_object_to_curve(bpy.types.Operator):
# Remove temporary curve.
obj.to_curve_clear()
# Invoke to_curve() with applying modifiers.
- curve_with_modifiers = obj.to_curve(depsgraph, apply_modifiers = True)
+ curve_with_modifiers = obj.to_curve(depsgraph, apply_modifiers=True)
self.report({'INFO'}, f"{len(curve_with_modifiers.splines)} splines in new curve with modifiers.")
# Remove temporary curve.
obj.to_curve_clear()
diff --git a/doc/python_api/examples/gpu.6.py b/doc/python_api/examples/gpu.6.py
index 334a606055a..be164a03028 100644
--- a/doc/python_api/examples/gpu.6.py
+++ b/doc/python_api/examples/gpu.6.py
@@ -21,6 +21,7 @@ batch = batch_for_shader(
},
)
+
def draw():
shader.bind()
shader.uniform_sampler("image", texture)