[Bf-extensions-cvs] [4744a96] master: Remove checks for older Blender versions

Campbell Barton noreply at git.blender.org
Mon Aug 1 01:07:21 CEST 2016


Commit: 4744a96bea1afd11b70b2f1932ca2072a0f17dc9
Author: Campbell Barton
Date:   Mon Aug 1 09:09:28 2016 +1000
Branches: master
https://developer.blender.org/rBA4744a96bea1afd11b70b2f1932ca2072a0f17dc9

Remove checks for older Blender versions

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

M	mesh_tiny_cad/BIX.py
M	mesh_tiny_cad/V2X.py
M	mesh_tiny_cad/VTX.py
M	mesh_tiny_cad/XALL.py

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

diff --git a/mesh_tiny_cad/BIX.py b/mesh_tiny_cad/BIX.py
index 4f02189..faac521 100644
--- a/mesh_tiny_cad/BIX.py
+++ b/mesh_tiny_cad/BIX.py
@@ -30,9 +30,8 @@ def add_line_to_bisection(self):
     me = obj.data
     bm = bmesh.from_edit_mesh(me)
 
-    if hasattr(bm.verts, "ensure_lookup_table"):
-        bm.verts.ensure_lookup_table()
-        bm.edges.ensure_lookup_table()
+    bm.verts.ensure_lookup_table()
+    bm.edges.ensure_lookup_table()
 
     edges = [e for e in bm.edges if e.select and not e.hide]
 
diff --git a/mesh_tiny_cad/V2X.py b/mesh_tiny_cad/V2X.py
index 69eaeb8..c230f4a 100644
--- a/mesh_tiny_cad/V2X.py
+++ b/mesh_tiny_cad/V2X.py
@@ -40,9 +40,7 @@ def add_vertex_to_intersection():
             iv = (iv[0] + iv[1]) / 2
             bm.verts.new(iv)
 
-            # precaution?
-            if hasattr(bm.verts, "ensure_lookup_table"):
-                bm.verts.ensure_lookup_table()
+            bm.verts.ensure_lookup_table()
 
             bm.verts[-1].select = True
             bmesh.update_edit_mesh(me)
diff --git a/mesh_tiny_cad/VTX.py b/mesh_tiny_cad/VTX.py
index 8a8c4e8..5ad035b 100644
--- a/mesh_tiny_cad/VTX.py
+++ b/mesh_tiny_cad/VTX.py
@@ -106,7 +106,7 @@ def perform_vtx(bm, pt, edges, pts, vertex_indices):
 
 def do_vtx_if_appropriate(bm, edges):
     vertex_indices = cm.get_vert_indices_from_bmedges(edges)
-    
+
     # test 1, are there shared vers? if so return non-viable
     if not len(set(vertex_indices)) == 4:
         return {'SHARED_VERTEX'}
diff --git a/mesh_tiny_cad/XALL.py b/mesh_tiny_cad/XALL.py
index c160539..8cd25a5 100644
--- a/mesh_tiny_cad/XALL.py
+++ b/mesh_tiny_cad/XALL.py
@@ -32,6 +32,7 @@ def order_points(edge, point_list):
     ''' order these edges from distance to v1, then
     sandwich the sorted list with v1, v2 '''
     v1, v2 = edge
+
     def dist(co):
         return (v1 - co).length
     point_list = sorted(point_list, key=dist)
@@ -75,9 +76,8 @@ def can_skip(closest_points, vert_vectors):
 
 def get_intersection_dictionary(bm, edge_indices):
 
-    if hasattr(bm.verts, "ensure_lookup_table"):
-        bm.verts.ensure_lookup_table()
-        bm.edges.ensure_lookup_table()
+    bm.verts.ensure_lookup_table()
+    bm.edges.ensure_lookup_table()
 
     permutations = get_valid_permutations(bm, edge_indices)



More information about the Bf-extensions-cvs mailing list