diff options
author | lijenstina <lijenstina@gmail.com> | 2017-06-13 17:10:44 +0300 |
---|---|---|
committer | lijenstina <lijenstina@gmail.com> | 2017-06-13 17:10:44 +0300 |
commit | f5c236b78b436416c2a9da38c943e6fe1df28a82 (patch) | |
tree | 2e514d5e8e4ad96bc5d6f7816712e9968b875b2d | |
parent | eaf47415b2687621fb0e542ba4195476d1e6c7d8 (diff) |
Edit Tools 2: fix failing poll with mesh_edge_roundifier
Bumped version to 0.3.4
Poll was failing when the active object was None
-rw-r--r-- | mesh_extra_tools/__init__.py | 2 | ||||
-rw-r--r-- | mesh_extra_tools/mesh_edge_roundifier.py | 41 |
2 files changed, 26 insertions, 17 deletions
diff --git a/mesh_extra_tools/__init__.py b/mesh_extra_tools/__init__.py index eeeb7594..3ea99e58 100644 --- a/mesh_extra_tools/__init__.py +++ b/mesh_extra_tools/__init__.py @@ -25,7 +25,7 @@ bl_info = { "name": "Edit Tools 2", "author": "meta-androcto", - "version": (0, 3, 3), + "version": (0, 3, 4), "blender": (2, 78, 0), "location": "View3D > Toolshelf > Tools and Specials (W-key)", "description": "Extra mesh edit tools - modifying meshes and selection", diff --git a/mesh_extra_tools/mesh_edge_roundifier.py b/mesh_extra_tools/mesh_edge_roundifier.py index e8ef63b3..de3eb2bf 100644 --- a/mesh_extra_tools/mesh_edge_roundifier.py +++ b/mesh_extra_tools/mesh_edge_roundifier.py @@ -20,7 +20,7 @@ bl_info = { "name": "Edge Roundifier", "category": "Mesh", "author": "Piotr Komisarczyk (komi3D), PKHG", - "version": (1, 0, 0), + "version": (1, 0, 1), "blender": (2, 7, 3), "location": "SPACE > Edge Roundifier or CTRL-E > " "Edge Roundifier or Tools > Addons > Edge Roundifier", @@ -224,7 +224,7 @@ class CalculationHelper: return refPoint -# SELECTION METHODS # +# Selection Methods # class SelectionHelper: @@ -414,8 +414,10 @@ class EdgeRoundifier(Operator): description="Entry mode switch between Angle and Radius\n" "If Angle is selected, arc radius is calculated from it" ) - rotateCenterItems = [("Spin", "Spin", ""), ("V1", "V1", ""), - ("Edge", "Edge", ""), ("V2", "V2", "")] + rotateCenterItems = [ + ("Spin", "Spin", ""), ("V1", "V1", ""), + ("Edge", "Edge", ""), ("V2", "V2", "") + ] rotateCenter = EnumProperty( items=rotateCenterItems, name="", @@ -429,10 +431,12 @@ class EdgeRoundifier(Operator): default='FullEdgeArc', description="Arc mode - switch between Full and Half arcs" ) - angleItems = [('Other', "Other", "User defined angle"), ('180', "180", "HemiCircle (2 sides)"), - ('120', "120", "TriangleCircle (3 sides)"), ('90', "90", "QuadCircle (4 sides)"), - ('72', "72", "PentagonCircle (5 sides)"), ('60', "60", "HexagonCircle (6 sides)"), - ('45', "45", "OctagonCircle (8 sides)"), ('30', "30", "DodecagonCircle (12 sides)")] + angleItems = [ + ('Other', "Other", "User defined angle"), ('180', "180", "HemiCircle (2 sides)"), + ('120', "120", "TriangleCircle (3 sides)"), ('90', "90", "QuadCircle (4 sides)"), + ('72', "72", "PentagonCircle (5 sides)"), ('60', "60", "HexagonCircle (6 sides)"), + ('45', "45", "OctagonCircle (8 sides)"), ('30', "30", "DodecagonCircle (12 sides)") + ] angleEnum = EnumProperty( items=angleItems, name="", @@ -447,18 +451,22 @@ class EdgeRoundifier(Operator): default='ORG', description="Reference location used to calculate initial centers of drawn arcs" ) - planeItems = [(XY, "XY", "XY Plane (Z=0)"), - (YZ, "YZ", "YZ Plane (X=0)"), - (XZ, "XZ", "XZ Plane (Y=0)")] + planeItems = [ + (XY, "XY", "XY Plane (Z=0)"), + (YZ, "YZ", "YZ Plane (X=0)"), + (XZ, "XZ", "XZ Plane (Y=0)") + ] planeEnum = EnumProperty( items=planeItems, name="", default='XY', description="Plane used to calculate spin plane of drawn arcs" ) - edgeScaleCenterItems = [('V1', "V1", "v1 - First Edge's Vertex"), - ('CENTER', "Center", "Center of the Edge"), - ('V2', "V2", "v2 - Second Edge's Vertex")] + edgeScaleCenterItems = [ + ('V1', "V1", "v1 - First Edge's Vertex"), + ('CENTER', "Center", "Center of the Edge"), + ('V2', "V2", "v2 - Second Edge's Vertex") + ] edgeScaleCenterEnum = EnumProperty( items=edgeScaleCenterItems, name="Edge scale center", @@ -471,8 +479,9 @@ class EdgeRoundifier(Operator): @classmethod def poll(cls, context): - return ((context.scene.objects.active.type == 'MESH') and - (context.scene.objects.active.mode == 'EDIT')) + obj = context.active_object + return (obj and obj.type == 'MESH' and + obj.mode == 'EDIT') def prepareMesh(self, context): bpy.ops.object.mode_set(mode='OBJECT') |