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
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2019-10-16 11:36:01 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-10-16 11:36:01 +0300
commitc2fbe46b0f0fde44b8a40d89601a195da27d28fb (patch)
treef66e3e50758acb36001e2774c6e4ede5fc8bead6 /release/scripts/templates_py
parent386ba094988fc793f8e060d15438566e5e2d2cae (diff)
parentdcf57e34f3866bba5ddd9cfdfe858a1a5eedc4c2 (diff)
Merge branch 'master' into temp-gpencil-drw-enginetemp-gpencil-drw-engine
Diffstat (limited to 'release/scripts/templates_py')
-rw-r--r--release/scripts/templates_py/operator_mesh_add.py17
-rw-r--r--release/scripts/templates_py/operator_modal_draw.py1
-rw-r--r--release/scripts/templates_py/ui_tool_simple.py11
3 files changed, 17 insertions, 12 deletions
diff --git a/release/scripts/templates_py/operator_mesh_add.py b/release/scripts/templates_py/operator_mesh_add.py
index d3df64a5501..01a9ad6160e 100644
--- a/release/scripts/templates_py/operator_mesh_add.py
+++ b/release/scripts/templates_py/operator_mesh_add.py
@@ -2,6 +2,7 @@ import bpy
import bmesh
from bpy_extras.object_utils import AddObjectHelper
+
def add_box(width, height, depth):
"""
This function takes inputs and returns vertex and face arrays.
@@ -77,16 +78,16 @@ class AddBox(bpy.types.Operator):
# generic transform props
align_items = (
- ('WORLD', "World", "Align the new object to the world"),
- ('VIEW', "View", "Align the new object to the view"),
- ('CURSOR', "3D Cursor", "Use the 3D cursor orientation for the new object")
+ ('WORLD', "World", "Align the new object to the world"),
+ ('VIEW', "View", "Align the new object to the view"),
+ ('CURSOR', "3D Cursor", "Use the 3D cursor orientation for the new object")
)
align: EnumProperty(
- name="Align",
- items=align_items,
- default='WORLD',
- update=AddObjectHelper.align_update_callback,
- )
+ name="Align",
+ items=align_items,
+ default='WORLD',
+ update=AddObjectHelper.align_update_callback,
+ )
location: FloatVectorProperty(
name="Location",
subtype='TRANSLATION',
diff --git a/release/scripts/templates_py/operator_modal_draw.py b/release/scripts/templates_py/operator_modal_draw.py
index 5dc72c36a8f..1e185ecfe2b 100644
--- a/release/scripts/templates_py/operator_modal_draw.py
+++ b/release/scripts/templates_py/operator_modal_draw.py
@@ -4,6 +4,7 @@ import blf
import gpu
from gpu_extras.batch import batch_for_shader
+
def draw_callback_px(self, context):
print("mouse points", len(self.mouse_path))
diff --git a/release/scripts/templates_py/ui_tool_simple.py b/release/scripts/templates_py/ui_tool_simple.py
index afda5088e69..fc239093b9c 100644
--- a/release/scripts/templates_py/ui_tool_simple.py
+++ b/release/scripts/templates_py/ui_tool_simple.py
@@ -3,9 +3,10 @@
import bpy
from bpy.types import WorkSpaceTool
+
class MyTool(WorkSpaceTool):
- bl_space_type='VIEW_3D'
- bl_context_mode='OBJECT'
+ bl_space_type = 'VIEW_3D'
+ bl_context_mode = 'OBJECT'
# The prefix of the idname should be your add-on name.
bl_idname = "my_template.my_circle_select"
@@ -30,8 +31,8 @@ class MyTool(WorkSpaceTool):
class MyOtherTool(WorkSpaceTool):
- bl_space_type='VIEW_3D'
- bl_context_mode='OBJECT'
+ bl_space_type = 'VIEW_3D'
+ bl_context_mode = 'OBJECT'
bl_idname = "my_template.my_other_select"
bl_label = "My Lasso Tool Select"
@@ -56,9 +57,11 @@ def register():
bpy.utils.register_tool(MyTool, after={"builtin.scale_cage"}, separator=True, group=True)
bpy.utils.register_tool(MyOtherTool, after={MyTool.bl_idname})
+
def unregister():
bpy.utils.unregister_tool(MyTool)
bpy.utils.unregister_tool(MyOtherTool)
+
if __name__ == "__main__":
register()