[Bf-extensions-cvs] [01370f87] blender2.8: Print3D: use annotations

Campbell Barton noreply at git.blender.org
Tue Oct 2 02:19:49 CEST 2018


Commit: 01370f8794eb19ed651b9bfe317de6525944bb50
Author: Campbell Barton
Date:   Tue Oct 2 10:18:55 2018 +1000
Branches: blender2.8
https://developer.blender.org/rBA01370f8794eb19ed651b9bfe317de6525944bb50

Print3D: use annotations

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

M	object_print3d_utils/__init__.py
M	object_print3d_utils/operators.py

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

diff --git a/object_print3d_utils/__init__.py b/object_print3d_utils/__init__.py
index 5666d057..68fe48ea 100644
--- a/object_print3d_utils/__init__.py
+++ b/object_print3d_utils/__init__.py
@@ -59,64 +59,66 @@ else:
 
 
 class Print3D_Scene_Props(PropertyGroup):
-    export_format = EnumProperty(
-            name="Format",
-            description="Format type to export to",
-            items=(('STL', "STL", ""),
-                   ('PLY', "PLY", ""),
-                   ('WRL', "VRML2", ""),
-                   ('X3D', "X3D", ""),
-                   ('OBJ', "OBJ", "")),
-            default='STL',
-            )
-    use_export_texture = BoolProperty(
-            name="Copy Textures",
-            description="Copy textures on export to the output path",
-            default=False,
-            )
-    use_apply_scale = BoolProperty(
-            name="Apply Scale",
-            description="Apply scene scale setting on export",
-            default=False,
-            )
-    export_path = StringProperty(
-            name="Export Directory",
-            description="Path to directory where the files are created",
-            default="//", maxlen=1024, subtype="DIR_PATH",
-            )
-    thickness_min = FloatProperty(
-            name="Thickness",
-            description="Minimum thickness",
-            subtype='DISTANCE',
-            default=0.001,  # 1mm
-            min=0.0, max=10.0,
-            )
-    threshold_zero = FloatProperty(
-            name="Threshold",
-            description="Limit for checking zero area/length",
-            default=0.0001,
-            precision=5,
-            min=0.0, max=0.2,
-            )
-    angle_distort = FloatProperty(
-            name="Angle",
-            description="Limit for checking distorted faces",
-            subtype='ANGLE',
-            default=math.radians(45.0),
-            min=0.0, max=math.radians(180.0),
-            )
-    angle_sharp = FloatProperty(
-            name="Angle",
-            subtype='ANGLE',
-            default=math.radians(160.0),
-            min=0.0, max=math.radians(180.0),
-            )
-    angle_overhang = FloatProperty(
-            name="Angle",
-            subtype='ANGLE',
-            default=math.radians(45.0),
-            min=0.0, max=math.radians(90.0),
-            )
+    export_format: EnumProperty(
+        name="Format",
+        description="Format type to export to",
+        items=(
+            ('STL', "STL", ""),
+            ('PLY', "PLY", ""),
+            ('WRL', "VRML2", ""),
+            ('X3D', "X3D", ""),
+            ('OBJ', "OBJ", ""),
+        ),
+        default='STL',
+    )
+    use_export_texture: BoolProperty(
+        name="Copy Textures",
+        description="Copy textures on export to the output path",
+        default=False,
+    )
+    use_apply_scale: BoolProperty(
+        name="Apply Scale",
+        description="Apply scene scale setting on export",
+        default=False,
+    )
+    export_path: StringProperty(
+        name="Export Directory",
+        description="Path to directory where the files are created",
+        default="//", maxlen=1024, subtype="DIR_PATH",
+    )
+    thickness_min: FloatProperty(
+        name="Thickness",
+        description="Minimum thickness",
+        subtype='DISTANCE',
+        default=0.001,  # 1mm
+        min=0.0, max=10.0,
+    )
+    threshold_zero: FloatProperty(
+        name="Threshold",
+        description="Limit for checking zero area/length",
+        default=0.0001,
+        precision=5,
+        min=0.0, max=0.2,
+    )
+    angle_distort: FloatProperty(
+        name="Angle",
+        description="Limit for checking distorted faces",
+        subtype='ANGLE',
+        default=math.radians(45.0),
+        min=0.0, max=math.radians(180.0),
+    )
+    angle_sharp: FloatProperty(
+        name="Angle",
+        subtype='ANGLE',
+        default=math.radians(160.0),
+        min=0.0, max=math.radians(180.0),
+    )
+    angle_overhang: FloatProperty(
+        name="Angle",
+        subtype='ANGLE',
+        default=math.radians(45.0),
+        min=0.0, max=math.radians(90.0),
+    )
 
 
 # Update panel category name
diff --git a/object_print3d_utils/operators.py b/object_print3d_utils/operators.py
index af8a29e8..ebc1a730 100644
--- a/object_print3d_utils/operators.py
+++ b/object_print3d_utils/operators.py
@@ -23,15 +23,15 @@
 import bpy
 from bpy.types import Operator
 from bpy.props import (
-        IntProperty,
-        FloatProperty,
-        )
+    IntProperty,
+    FloatProperty,
+)
 import bmesh
 
 from . import (
-        mesh_helpers,
-        report,
-        )
+    mesh_helpers,
+    report,
+)
 
 
 def clean_float(text):
@@ -430,16 +430,16 @@ class MESH_OT_Print3D_Clean_Non_Manifold(Operator):
     bl_label = "Print3D Clean Non-Manifold and Inverted"
     bl_options = {'REGISTER', 'UNDO'}
 
-    threshold = bpy.props.FloatProperty(
-            name="threshold",
-            description="Minimum distance between elements to merge",
-            default=0.0001,
-            )
-    sides = bpy.props.IntProperty(
-            name="sides",
-            description="Number of sides in hole required to fill",
-            default=4,
-            )
+    threshold: bpy.props.FloatProperty(
+        name="threshold",
+        description="Minimum distance between elements to merge",
+        default=0.0001,
+    )
+    sides: bpy.props.IntProperty(
+        name="sides",
+        description="Number of sides in hole required to fill",
+        default=4,
+    )
 
     def execute(self, context):
         self.context = context
@@ -600,7 +600,7 @@ class MESH_OT_Print3D_Select_Report(Operator):
     bl_label = "Print3D Select Report"
     bl_options = {'INTERNAL'}
 
-    index = IntProperty()
+    index: IntProperty()
 
     _type_to_mode = {
         bmesh.types.BMVert: 'VERT',
@@ -659,14 +659,14 @@ class MESH_OT_Print3D_Scale_To_Volume(Operator):
     bl_label = "Scale to Volume"
     bl_options = {'REGISTER', 'UNDO'}
 
-    volume_init = FloatProperty(
-            options={'HIDDEN'},
-            )
-    volume = FloatProperty(
-            name="Volume",
-            unit='VOLUME',
-            min=0.0, max=100000.0,
-            )
+    volume_init: FloatProperty(
+        options={'HIDDEN'},
+    )
+    volume: FloatProperty(
+        name="Volume",
+        unit='VOLUME',
+        min=0.0, max=100000.0,
+    )
 
     def execute(self, context):
         import math
@@ -705,17 +705,17 @@ class MESH_OT_Print3D_Scale_To_Bounds(Operator):
     bl_label = "Scale to Bounds"
     bl_options = {'REGISTER', 'UNDO'}
 
-    length_init = FloatProperty(
-            options={'HIDDEN'},
-            )
-    axis_init = IntProperty(
-            options={'HIDDEN'},
-            )
-    length = FloatProperty(
-            name="Length Limit",
-            unit='LENGTH',
-            min=0.0, max=100000.0,
-            )
+    length_init: FloatProperty(
+        options={'HIDDEN'},
+    )
+    axis_init: IntProperty(
+        options={'HIDDEN'},
+    )
+    length: FloatProperty(
+        name="Length Limit",
+        unit='LENGTH',
+        min=0.0, max=100000.0,
+    )
 
     def execute(self, context):
         scale = self.length / self.length_init



More information about the Bf-extensions-cvs mailing list