[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42062] branches/bmesh/blender/source/ blender/blenlib/intern/scanfill.c: Fix for [#28528] Disappearing Faces

Andrew Wiggin ender79bl at gmail.com
Tue Nov 22 15:04:34 CET 2011


Revision: 42062
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42062
Author:   ender79
Date:     2011-11-22 14:04:33 +0000 (Tue, 22 Nov 2011)
Log Message:
-----------
Fix for [#28528] Disappearing Faces

Bring back some old scanfill code to handle tesselating polys with some zero-length edges. This code used to cause #4544 but I haven't been able to recreate that now, so I'm going to revive the old code and if #4544 does come back, we'll have to fix it some other way I guess (or come up with a better solution for zero-length edges in polys).

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/blenlib/intern/scanfill.c

Modified: branches/bmesh/blender/source/blender/blenlib/intern/scanfill.c
===================================================================
--- branches/bmesh/blender/source/blender/blenlib/intern/scanfill.c	2011-11-22 14:00:17 UTC (rev 42061)
+++ branches/bmesh/blender/source/blender/blenlib/intern/scanfill.c	2011-11-22 14:04:33 UTC (rev 42062)
@@ -550,7 +550,7 @@
 				}
 				else {
 					eed->v2->f= 255;
-					eed->v2->tmp.v = eed->v1->tmp.v;
+					eed->v2->tmp.v = eed->v1;
 				}
 			}
 		}
@@ -582,18 +582,21 @@
 		nexted= eed->next;
 		eed->f= 0;
 		BLI_remlink(&filledgebase,eed);
-/* commented all of this out, this I have no idea for what it is for, probably from ancient past */
-/* it does crash blender, since it uses mixed original and new vertices (ton) */
-//		if(eed->v1->f==255) {
-//			v1= eed->v1;
-//			while((eed->v1->f == 255) && (eed->v1->tmp.v != v1)) 
-//				eed->v1 = eed->v1->tmp.v;
-//		}
-//		if(eed->v2->f==255) {
-//			v2= eed->v2;
-//			while((eed->v2->f == 255) && (eed->v2->tmp.v != v2))
-//				eed->v2 = eed->v2->tmp.v;
-//		}
+		/* This code is for handling zero-length edges that get
+		   collapsed in step 0. It was removed for some time to
+		   fix trunk bug #4544, so if that comes back, this code
+		   may need some work, or there will have to be a better
+		   fix to #4544. */
+		if(eed->v1->f==255) {
+			v1= eed->v1;
+			while((eed->v1->f == 255) && (eed->v1->tmp.v != v1)) 
+				eed->v1 = eed->v1->tmp.v;
+		}
+		if(eed->v2->f==255) {
+			v2= eed->v2;
+			while((eed->v2->f == 255) && (eed->v2->tmp.v != v2))
+				eed->v2 = eed->v2->tmp.v;
+		}
 		if(eed->v1!=eed->v2) addedgetoscanlist(eed,verts);
 
 		eed= nexted;




More information about the Bf-blender-cvs mailing list