[Bf-extensions-cvs] [fb9e43f5] master: Carver MT: Update to version 1.1.8, various fixes

lijenstina noreply at git.blender.org
Mon Feb 26 22:10:51 CET 2018


Commit: fb9e43f512293f0fd7a1bb101e832e330c9f9784
Author: lijenstina
Date:   Mon Feb 26 22:09:40 2018 +0100
Branches: master
https://developer.blender.org/rBAfb9e43f512293f0fd7a1bb101e832e330c9f9784

Carver MT: Update to version 1.1.8, various fixes

Bump version to 1.1.8
Remove the Boolean mode toggles and bgl related code
Remove some of the unused variables
Some code style tweaks
Translate some previously missed tooltips

Simplify some of the repetive code
Use a property group for some of the scene props

Fix crashes:
- If there are any selected objects that are not meshes
- Fix an error in master related to storing selection (invalid object)
- Fix memory leak on quiting Blender while the operator is running

Note:
Concerning the E722 Pep8 - Bare Except Warning since there is a notice
with a full exception it can be disregarded

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

M	mesh_carver.py

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

diff --git a/mesh_carver.py b/mesh_carver.py
index aa388a15..16308aa4 100644
--- a/mesh_carver.py
+++ b/mesh_carver.py
@@ -21,37 +21,44 @@ bl_info = {
     "name": "Carver MT",
     "category": "Object",
     "author": "Pixivore, Cedric LEPILLER, Ted Milker",
-    "version": (1, 1, 7),
-    "blender": (2, 77, 0),
+    "version": (1, 1, 8),
+    "blender": (2, 79, 2),
     "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/"
                 "Scripts/Modeling/Carver",
     "description": "Multiple tools to carve or to create objects",
-    }
+}
 
 import bpy
 import bgl
 import blf
 import math
-import mathutils
 import sys
 import random
 import bmesh
+from mathutils import (
+    Color,
+    Euler,
+    Matrix,
+    Vector,
+    Quaternion,
+)
 import bpy_extras
 from bpy.props import (
-        BoolProperty,
-        EnumProperty,
-        IntProperty,
-        StringProperty,
-        )
+    BoolProperty,
+    IntProperty,
+    PointerProperty,
+    StringProperty,
+)
 from bpy_extras import view3d_utils
 from bpy_extras.view3d_utils import (
-        region_2d_to_vector_3d,
-        region_2d_to_location_3d,
-        )
+    region_2d_to_vector_3d,
+    region_2d_to_location_3d,
+)
+
 
 Profils = [
     ("CTP_4882",
-     mathutils.Vector((2.61824, -5.56469, 0)),
+      Vector((2.61824, -5.56469, 0)),
      [(-1.156501, 0.799282, 0.032334),
       (-0.967583, 0.838861, 0.032334),
       (-1.10386, 0.846403, 0.032334),
@@ -108,7 +115,7 @@ Profils = [
       [38, 39, 47], [34, 32, 35], [39, 46, 47], [43, 34, 35], [35, 38, 47], [47, 42, 35], [32, 33, 35],
       [42, 40, 43], [36, 37, 39], [42, 43, 35], [44, 45, 47], [46, 44, 47]]),
     ("CTP_8354",
-     mathutils.Vector((-0.06267, -2.43829, -0.0)),
+     Vector((-0.06267, -2.43829, -0.0)),
      [(-0.534254, -1.0, 0.032334),
       (-1.0, -0.534254, 0.032334),
       (-0.654798, -0.98413, 0.032334),
@@ -212,7 +219,7 @@ Profils = [
       [48, 71, 80, 47], [67, 37, 38, 83], [82, 83, 87, 86], [81, 82, 86, 85], [80, 81, 85, 84], [47, 80, 84, 46],
       [83, 38, 39, 87]]),
     ("CTP_5585",
-     mathutils.Vector((5.0114, -2.4281, 0.0)),
+     Vector((5.0114, -2.4281, 0.0)),
      [(-0.490711, -1.0, 0.032334),
       (-1.0, -0.490711, 0.032334),
       (1.0, -0.490711, 0.032334),
@@ -233,7 +240,7 @@ Profils = [
      [[11, 12, 13, 14], [9, 8, 4, 1], [10, 9, 1, 0], [11, 10, 0, 3], [12, 11, 3, 2], [13, 12, 2, 7],
       [14, 13, 7, 6], [15, 14, 6, 5], [8, 15, 5, 4], [9, 10, 15, 8], [10, 11, 14, 15]]),
     ("CTP_6960",
-     mathutils.Vector((-0.11417, 2.48371, -0.0)),
+     Vector((-0.11417, 2.48371, -0.0)),
      [(0.0, 1.0, 0.016827),
       (-0.382683, 0.92388, 0.016827),
       (-0.707107, 0.707107, 0.016827),
@@ -271,7 +278,7 @@ Profils = [
       [6, 22, 21, 5], [14, 30, 29, 13], [7, 23, 22, 6], [15, 31, 30, 14], [8, 24, 23, 7], [1, 17, 16, 0],
       [0, 16, 31, 15], [9, 25, 24, 8], [2, 18, 17, 1], [10, 26, 25, 9]]),
     ("CTP_5359",
-     mathutils.Vector((5.50446, 2.41669, -0.0)),
+     Vector((5.50446, 2.41669, -0.0)),
      [(0.0, 0.714247, 0.023261),
       (-0.382683, 0.659879, 0.023261),
       (-0.707107, 0.505049, 0.023261),
@@ -309,7 +316,7 @@ Profils = [
       [6, 22, 21, 5], [14, 30, 29, 13], [7, 23, 22, 6], [15, 31, 30, 14], [8, 24, 23, 7], [1, 17, 16, 0],
       [0, 16, 31, 15], [9, 25, 24, 8], [2, 18, 17, 1], [10, 26, 25, 9]]),
     ("CTP_5424",
-     mathutils.Vector((2.61824, 2.34147, 0.0)),
+     Vector((2.61824, 2.34147, 0.0)),
      [(1.0, -1.0, 0.032334),
       (-1.0, 1.0, 0.032334),
       (1.0, 1.0, 0.032334),
@@ -328,7 +335,7 @@ Profils = [
      [[3, 0, 2], [10, 9, 2], [2, 1, 4], [2, 4, 13], [5, 3, 2], [6, 5, 2], [2, 13, 12], [2, 12, 11], [7, 6, 2],
       [8, 7, 2], [2, 11, 10], [9, 8, 2]]),
     ("CTP_3774",
-     mathutils.Vector((2.61824, -2.52425, 0.0)),
+     Vector((2.61824, -2.52425, 0.0)),
      [(1.0, 0.0, 0.020045),
       (-1.0, 0.0, 0.020045),
       (0.31903, -0.664947, 0.020045),
@@ -367,7 +374,7 @@ Profils = [
       [11, 30, 9, 12], [17, 16, 27, 26], [14, 17, 26, 24], [24, 25, 0, 14], [15, 13, 27, 16], [9, 30, 23, 4],
       [31, 29, 7, 18], [28, 31, 18, 21], [30, 28, 21, 23]]),
     ("CTP_4473",
-     mathutils.Vector((7.31539, 0.0, 0.0)),
+     Vector((7.31539, 0.0, 0.0)),
      [(0.24549, -1.0, 0.022454),
       (-0.24549, -1.0, 0.022454),
       (-0.24549, 1.0, 0.022454),
@@ -383,7 +390,7 @@ Profils = [
       ],
      [[8, 3, 2, 10], [0, 9, 11, 1], [4, 8, 9, 5], [8, 10, 11, 9], [10, 7, 6, 11]]),
     ("CTP_4003",
-     mathutils.Vector((4.91276, 0.0, 0.0)),
+     Vector((4.91276, 0.0, 0.0)),
      [(-1.0, -1.0, 0.026945),
       (1.0, -1.0, 0.026945),
       (-1.0, 1.0, 0.026945),
@@ -424,7 +431,7 @@ Profils = [
       [23, 25, 31, 29], [24, 23, 29, 30], [25, 22, 28, 31], [26, 22, 15, 20], [10, 27, 33, 5], [31, 28, 3, 11],
       [33, 30, 13, 14], [29, 31, 11, 12], [5, 33, 14, 1], [30, 29, 12, 13], [32, 28, 22, 26]]),
     ("CTP_3430",
-     mathutils.Vector((2.61824, 0.0, 0.0)),
+     Vector((2.61824, 0.0, 0.0)),
      [(-1.0, -1.0, 0.032334),
       (1.0, -1.0, 0.032334),
       (-1.0, 1.0, 0.032334),
@@ -432,7 +439,7 @@ Profils = [
       ],
      [[0, 1, 3, 2]]),
     ("CTP_7175",
-     mathutils.Vector((0.0, 0.0, 0.0)),
+     Vector((0.0, 0.0, 0.0)),
      [(-1.0, -1.0, 0.032334),
       (1.0, -1.0, 0.032334),
       (-1.0, 1.0, 0.032334),
@@ -464,33 +471,33 @@ class CarverPrefs(bpy.types.AddonPreferences):
     bl_idname = __name__
 
     Enable_Tab_01 = BoolProperty(
-            name="Info",
-            description="Some general information and settings about the add-on",
-            default=False
-            )
+        name="Info",
+        description="Some general information and settings about the add-on",
+        default=False
+    )
     Enable_Tab_02 = BoolProperty(
-            name="Hotkeys",
-            description="List of the shortcuts used during carving",
-            default=False
-            )
+        name="Hotkeys",
+        description="List of the shortcuts used during carving",
+        default=False
+    )
     bpy.types.Scene.Key_Create = StringProperty(
-            name="Object creation",
-            description="Object creation",
-            maxlen=1,
-            default="C"
-            )
+        name="Object creation",
+        description="Object creation",
+        maxlen=1,
+        default="C"
+    )
     bpy.types.Scene.Key_Update = StringProperty(
-            name="Auto Bevel Update",
-            description="Auto Bevel Update",
-            maxlen=1,
-            default="A",
-            )
+        name="Auto Bevel Update",
+        description="Auto Bevel Update",
+        maxlen=1,
+        default="A",
+    )
     bpy.types.Scene.Key_Bool = StringProperty(
-            name="Boolean type",
-            description="Boolean operation type",
-            maxlen=1,
-            default="T",
-            )
+        name="Boolean type",
+        description="Boolean operation type",
+        maxlen=1,
+        default="T",
+    )
     bpy.types.Scene.Key_Brush = StringProperty(
             name="Brush Mode",
             description="Brush Mode",
@@ -498,167 +505,150 @@ class CarverPrefs(bpy.types.AddonPreferences):
             default="B",
             )
     bpy.types.Scene.Key_Help = StringProperty(
-            name="Help display",
-            description="Help display",
-            maxlen=1,
-            default="H",
-            )
+        name="Help display",
+        description="Help display",
+        maxlen=1,
+        default="H",
+    )
     bpy.types.Scene.Key_Instant = StringProperty(
-            name="Instantiate",
-            description="Instantiate object",
-            maxlen=1,
-            default="I",
-            )
+        name="Instantiate",
+        description="Instantiate object",
+        maxlen=1,
+        default="I",
+    )
     bpy.types.Scene.Key_Close = StringProperty(
-            name="Close polygonal shape",
-            description="Close polygonal shape",
-            maxlen=1,
-            default="X",
-            )
+        name="Close polygonal shape",
+        description="Close polygonal shape",
+        maxlen=1,
+        default="X",
+    )
     bpy.types.Scene.Key_Apply = StringProperty(
-            name="Apply operation",
-            description="Apply operation",
-            maxlen=1,
-            default="Q",
-            )
+        name="Apply operation",
+        description="Apply operation",
+        maxlen=1,
+        default="Q",
+    )
     bpy.types.Scene.Key_Scale = StringProperty(
-            name="Scale object",
-            description="Scale object",
-            maxlen=1,
-            default="S",
-            )
+        name="Scale object",
+        description="Scale object",
+        maxlen=1,
+        default="S",
+    )
     bpy.types.Scene.Key_Gapy = StringProperty(
-            name="Gap rows",
-            description="Scale gap between columns",
-            maxlen=1,
-            default="J",
-            )
+        name="Gap rows",
+        description="Scale gap between columns",
+        maxlen=1,
+        default="J",
+    )
     bpy.types.Scene.Key_Gapx = StringProperty(
-            name="Gap columns",
-            description="Scale gap between columns",
-            maxlen=1,
-            default="U",
-            )
+        name="Gap columns",
+        description="Scale gap between columns",
+        maxlen=1,
+        default="U",
+    )
     bpy.types.Scene.Key_Depth = StringProperty(
-            name="Depth",
-            description="Cursor depth or solidify pattern",
-            maxlen=1,
-            default="D",
-            )
+        name="Depth",
+        description="Cursor depth or solidify pattern",
+        maxlen=1,
+        default="D",
+    )
     bpy.types.Scene.Key_BrushDepth = StringProperty(
-            name="Brush Depth",
-            description="Brush depth",
-            maxlen=1,
-            default="C",
-            )
+        name="Brush Depth",
+        description="Brush depth",
+        maxlen=1,
+        default="C",
+    )
     bpy.types.Scene.Key_Subadd = StringProperty(
-            name="Add subdivision",
-            description="Add su

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list