diff options
Diffstat (limited to 'release/scripts/templates')
-rw-r--r-- | release/scripts/templates/addon_add_object.py | 10 | ||||
-rw-r--r-- | release/scripts/templates/operator_export.py | 26 | ||||
-rw-r--r-- | release/scripts/templates/operator_mesh_add.py | 41 | ||||
-rw-r--r-- | release/scripts/templates/operator_modal_view3d.py | 5 |
4 files changed, 54 insertions, 28 deletions
diff --git a/release/scripts/templates/addon_add_object.py b/release/scripts/templates/addon_add_object.py index 98517fd97a0..833ac600995 100644 --- a/release/scripts/templates/addon_add_object.py +++ b/release/scripts/templates/addon_add_object.py @@ -45,10 +45,12 @@ class OBJECT_OT_add_object(bpy.types.Operator, AddObjectHelper): bl_description = "Create a new Mesh Object" bl_options = {'REGISTER', 'UNDO'} - scale = FloatVectorProperty(name='scale', - default=(1.0, 1.0, 1.0), - subtype='TRANSLATION', - description='scaling') + scale = FloatVectorProperty( + name='scale', + default=(1.0, 1.0, 1.0), + subtype='TRANSLATION', + description='scaling', + ) def execute(self, context): diff --git a/release/scripts/templates/operator_export.py b/release/scripts/templates/operator_export.py index 4cf943a53b7..aeda4ce36fb 100644 --- a/release/scripts/templates/operator_export.py +++ b/release/scripts/templates/operator_export.py @@ -24,18 +24,26 @@ class ExportSomeData(bpy.types.Operator, ExportHelper): # ExportHelper mixin class uses this filename_ext = ".txt" - filter_glob = StringProperty(default="*.txt", options={'HIDDEN'}) + filter_glob = StringProperty( + default="*.txt", + options={'HIDDEN'}, + ) # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. - use_setting = BoolProperty(name="Example Boolean", description="Example Tooltip", default=True) - - type = EnumProperty(items=(('OPT_A', "First Option", "Description one"), - ('OPT_B', "Second Option", "Description two."), - ), - name="Example Enum", - description="Choose between two items", - default='OPT_A') + use_setting = BoolProperty( + name="Example Boolean", + description="Example Tooltip", + default=True, + ) + + type = EnumProperty( + name="Example Enum", + description="Choose between two items", + items=(('OPT_A', "First Option", "Description one"), + ('OPT_B', "Second Option", "Description two.")), + default='OPT_A', + ) @classmethod def poll(cls, context): diff --git a/release/scripts/templates/operator_mesh_add.py b/release/scripts/templates/operator_mesh_add.py index 10d23a6712d..d89b7e82f77 100644 --- a/release/scripts/templates/operator_mesh_add.py +++ b/release/scripts/templates/operator_mesh_add.py @@ -43,25 +43,38 @@ class AddBox(bpy.types.Operator): bl_label = "Add Box" bl_options = {'REGISTER', 'UNDO'} - width = FloatProperty(name="Width", + width = FloatProperty( + name="Width", description="Box Width", - default=1.0, min=0.01, max=100.0) - - height = FloatProperty(name="Height", + min=0.01, max=100.0, + default=1.0, + ) + height = FloatProperty( + name="Height", description="Box Height", - default=1.0, min=0.01, max=100.0) - - depth = FloatProperty(name="Depth", + min=0.01, max=100.0, + default=1.0, + ) + depth = FloatProperty( + name="Depth", description="Box Depth", - default=1.0, min=0.01, max=100.0) + min=0.01, max=100.0, + default=1.0, + ) # generic transform props - view_align = BoolProperty(name="Align to View", - default=False) - location = FloatVectorProperty(name="Location", - subtype='TRANSLATION') - rotation = FloatVectorProperty(name="Rotation", - subtype='EULER') + view_align = BoolProperty( + name="Align to View", + default=False, + ) + location = FloatVectorProperty( + name="Location", + subtype='TRANSLATION', + ) + rotation = FloatVectorProperty( + name="Rotation", + subtype='EULER', + ) def execute(self, context): diff --git a/release/scripts/templates/operator_modal_view3d.py b/release/scripts/templates/operator_modal_view3d.py index 925449835ca..263bf72f129 100644 --- a/release/scripts/templates/operator_modal_view3d.py +++ b/release/scripts/templates/operator_modal_view3d.py @@ -8,7 +8,10 @@ class ViewOperator(bpy.types.Operator): bl_idname = "view3d.modal_operator" bl_label = "Simple View Operator" - offset = FloatVectorProperty(name="Offset", size=3) + offset = FloatVectorProperty( + name="Offset", + size=3, + ) def execute(self, context): v3d = context.space_data |