[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3721] contrib/py/scripts/addons/ mesh_edgetools.py: Fixed the order of a check with intersect_line_face to correct the script from checking bounds when it should not be .

Paul Marshall portsidepaul at hotmail.com
Thu Sep 6 21:05:34 CEST 2012


Revision: 3721
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3721
Author:   brikbot
Date:     2012-09-06 19:05:34 +0000 (Thu, 06 Sep 2012)
Log Message:
-----------
Fixed the order of a check with intersect_line_face to correct the script from checking bounds when it should not be.

Also have discovered a possible bug with bmesh.types.BMEdgeSeq.remove() crashing Blender - as such some functionality may be crippled until that is resolved.

Modified Paths:
--------------
    contrib/py/scripts/addons/mesh_edgetools.py

Modified: contrib/py/scripts/addons/mesh_edgetools.py
===================================================================
--- contrib/py/scripts/addons/mesh_edgetools.py	2012-09-06 07:21:22 UTC (rev 3720)
+++ contrib/py/scripts/addons/mesh_edgetools.py	2012-09-06 19:05:34 UTC (rev 3721)
@@ -523,7 +523,8 @@
         p1, p2, p3 = face.verts[0].co, face.verts[1].co, face.verts[2].co
         int_co = intersect_line_plane(edge.verts[0].co, edge.verts[1].co, p1, face.normal)
 
-        if int_co != None:
+        # Only check if the triangle is not being treated as an infinite plane:
+        if int_co != None and not is_infinite:
             pA = p1 - int_co
             pB = p2 - int_co
             pC = p3 - int_co
@@ -533,7 +534,7 @@
             sumA = aAB + aBC + aCA
 
             # If the point is outside the triangle:
-            if (sumA > (pi + error) and sumA < (pi - error)) and not is_infinite:
+            if (sumA > (pi + error) and sumA < (pi - error)):
                 int_co = None
 
     # This is the default case where we either have a planar quad or an n-gon.
@@ -1453,9 +1454,15 @@
                             newV1.co = intersection
                             newV2 = bVerts.new()
                             newV2.co = intersection
+                            if bpy.app.debug:
+                                print("New vertices were successfully created")
                             newE1 = bEdges.new((v1, newV1))
                             newE2 = bEdges.new((v2, newV2))
+                            if bpy.app.debug:
+                                print("New edges were successfully created")
                             bEdges.remove(e)
+                            if bpy.app.debug:
+                                print("Old edge successfully removed")
                         else:
                             new = list(bmesh.utils.edge_split(e, v1, 0.5))
                             new[1].co = intersection



More information about the Bf-extensions-cvs mailing list