From c2cdbe1e88f1397d624538589137c013e087c38a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 Apr 2022 15:10:14 +1000 Subject: Cleanup: run autopep8 on doc/ --- doc/python_api/examples/bpy.app.timers.5.py | 1 + doc/python_api/examples/bpy.types.Bone.convert_local_to_pose.py | 3 ++- doc/python_api/examples/bpy.types.Operator.1.py | 4 +++- doc/python_api/examples/bpy.types.Operator.2.py | 2 +- doc/python_api/examples/bpy.types.Operator.3.py | 3 ++- doc/python_api/examples/bpy.types.Operator.4.py | 6 ++++-- doc/python_api/examples/bpy.types.Operator.5.py | 6 ++++-- doc/python_api/examples/bpy.types.Operator.6.py | 4 +++- doc/python_api/examples/bpy.types.Operator.py | 8 +++++--- 9 files changed, 25 insertions(+), 12 deletions(-) (limited to 'doc/python_api') diff --git a/doc/python_api/examples/bpy.app.timers.5.py b/doc/python_api/examples/bpy.app.timers.5.py index ddda0576f05..9770c84d4be 100644 --- a/doc/python_api/examples/bpy.app.timers.5.py +++ b/doc/python_api/examples/bpy.app.timers.5.py @@ -11,6 +11,7 @@ import queue execution_queue = queue.Queue() + # This function can safely be called in another thread. # The function will be executed when the timer runs the next time. def run_in_main_thread(function): diff --git a/doc/python_api/examples/bpy.types.Bone.convert_local_to_pose.py b/doc/python_api/examples/bpy.types.Bone.convert_local_to_pose.py index 4a88096cf6f..36b161640c2 100644 --- a/doc/python_api/examples/bpy.types.Bone.convert_local_to_pose.py +++ b/doc/python_api/examples/bpy.types.Bone.convert_local_to_pose.py @@ -4,6 +4,7 @@ the middle of updating the armature without having to update dependencies after each change, by manually carrying updated matrices in a recursive walk. """ + def set_pose_matrices(obj, matrix_map): "Assign pose space matrices of all bones at once, ignoring constraints." @@ -11,7 +12,7 @@ def set_pose_matrices(obj, matrix_map): if pbone.name in matrix_map: matrix = matrix_map[pbone.name] - ## Instead of: + # # Instead of: # pbone.matrix = matrix # bpy.context.view_layer.update() diff --git a/doc/python_api/examples/bpy.types.Operator.1.py b/doc/python_api/examples/bpy.types.Operator.1.py index 84397574856..a28db7e84bb 100644 --- a/doc/python_api/examples/bpy.types.Operator.1.py +++ b/doc/python_api/examples/bpy.types.Operator.1.py @@ -42,10 +42,12 @@ class SimpleMouseOperator(bpy.types.Operator): self.y = event.mouse_y return self.execute(context) -# Only needed if you want to add into a dynamic menu + +# Only needed if you want to add into a dynamic menu. def menu_func(self, context): self.layout.operator(SimpleMouseOperator.bl_idname, text="Simple Mouse Operator") + # Register and add to the view menu (required to also use F3 search "Simple Mouse Operator" for quick access) bpy.utils.register_class(SimpleMouseOperator) bpy.types.VIEW3D_MT_view.append(menu_func) diff --git a/doc/python_api/examples/bpy.types.Operator.2.py b/doc/python_api/examples/bpy.types.Operator.2.py index 7ab0143b925..2a14d6b00f5 100644 --- a/doc/python_api/examples/bpy.types.Operator.2.py +++ b/doc/python_api/examples/bpy.types.Operator.2.py @@ -37,7 +37,7 @@ class ExportSomeData(bpy.types.Operator): return {'RUNNING_MODAL'} -# Only needed if you want to add into a dynamic menu +# Only needed if you want to add into a dynamic menu. def menu_func(self, context): self.layout.operator_context = 'INVOKE_DEFAULT' self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator") diff --git a/doc/python_api/examples/bpy.types.Operator.3.py b/doc/python_api/examples/bpy.types.Operator.3.py index 9a12a7e3615..fb40616d15d 100644 --- a/doc/python_api/examples/bpy.types.Operator.3.py +++ b/doc/python_api/examples/bpy.types.Operator.3.py @@ -27,7 +27,8 @@ class DialogOperator(bpy.types.Operator): wm = context.window_manager return wm.invoke_props_dialog(self) -# Only needed if you want to add into a dynamic menu + +# Only needed if you want to add into a dynamic menu. def menu_func(self, context): self.layout.operator(DialogOperator.bl_idname, text="Dialog Operator") diff --git a/doc/python_api/examples/bpy.types.Operator.4.py b/doc/python_api/examples/bpy.types.Operator.4.py index 00c9cd250b1..d33f6a6113d 100644 --- a/doc/python_api/examples/bpy.types.Operator.4.py +++ b/doc/python_api/examples/bpy.types.Operator.4.py @@ -41,11 +41,13 @@ class CustomDrawOperator(bpy.types.Operator): col.prop(self, "my_string") -# Only needed if you want to add into a dynamic menu + +# Only needed if you want to add into a dynamic menu. def menu_func(self, context): self.layout.operator(CustomDrawOperator.bl_idname, text="Custom Draw Operator") -# Register and add to the object menu (required to also use F3 search "Custom Draw Operator" for quick access) + +# Register and add to the object menu (required to also use F3 search "Custom Draw Operator" for quick access). bpy.utils.register_class(CustomDrawOperator) bpy.types.VIEW3D_MT_object.append(menu_func) diff --git a/doc/python_api/examples/bpy.types.Operator.5.py b/doc/python_api/examples/bpy.types.Operator.5.py index a0b4a6d6841..90c899f222e 100644 --- a/doc/python_api/examples/bpy.types.Operator.5.py +++ b/doc/python_api/examples/bpy.types.Operator.5.py @@ -55,11 +55,13 @@ class ModalOperator(bpy.types.Operator): context.window_manager.modal_handler_add(self) return {'RUNNING_MODAL'} -# Only needed if you want to add into a dynamic menu + +# Only needed if you want to add into a dynamic menu. def menu_func(self, context): self.layout.operator(ModalOperator.bl_idname, text="Modal Operator") -# Register and add to the object menu (required to also use F3 search "Modal Operator" for quick access) + +# Register and add to the object menu (required to also use F3 search "Modal Operator" for quick access). bpy.utils.register_class(ModalOperator) bpy.types.VIEW3D_MT_object.append(menu_func) diff --git a/doc/python_api/examples/bpy.types.Operator.6.py b/doc/python_api/examples/bpy.types.Operator.6.py index 20ee4c21446..cf556c63ab8 100644 --- a/doc/python_api/examples/bpy.types.Operator.6.py +++ b/doc/python_api/examples/bpy.types.Operator.6.py @@ -31,10 +31,12 @@ class SearchEnumOperator(bpy.types.Operator): context.window_manager.invoke_search_popup(self) return {'RUNNING_MODAL'} -# Only needed if you want to add into a dynamic menu + +# Only needed if you want to add into a dynamic menu. def menu_func(self, context): self.layout.operator(SearchEnumOperator.bl_idname, text="Search Enum Operator") + # Register and add to the object menu (required to also use F3 search "Search Enum Operator" for quick access) bpy.utils.register_class(SearchEnumOperator) bpy.types.VIEW3D_MT_object.append(menu_func) diff --git a/doc/python_api/examples/bpy.types.Operator.py b/doc/python_api/examples/bpy.types.Operator.py index 5299b198774..41b96ac402f 100644 --- a/doc/python_api/examples/bpy.types.Operator.py +++ b/doc/python_api/examples/bpy.types.Operator.py @@ -22,13 +22,15 @@ class HelloWorldOperator(bpy.types.Operator): print("Hello World") return {'FINISHED'} -# Only needed if you want to add into a dynamic menu + +# Only needed if you want to add into a dynamic menu. def menu_func(self, context): self.layout.operator(HelloWorldOperator.bl_idname, text="Hello World Operator") -# Register and add to the view menu (required to also use F3 search "Hello World Operator" for quick access) + +# Register and add to the view menu (required to also use F3 search "Hello World Operator" for quick access). bpy.utils.register_class(HelloWorldOperator) bpy.types.VIEW3D_MT_view.append(menu_func) -# test call to the newly defined operator +# Test call to the newly defined operator. bpy.ops.wm.hello_world() -- cgit v1.2.3