[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36176] branches/bmesh/blender: fixed idling problem

Joseph Eagar joeedh at gmail.com
Fri Apr 15 04:13:40 CEST 2011


Revision: 36176
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36176
Author:   joeedh
Date:     2011-04-15 02:13:37 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
fixed idling problem

Modified Paths:
--------------
    branches/bmesh/blender/intern/ghost/intern/GHOST_EventManager.cpp
    branches/bmesh/blender/source/blender/bmesh/bmesh_error.h
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mods.c
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_newcore.c
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
    branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c

Modified: branches/bmesh/blender/intern/ghost/intern/GHOST_EventManager.cpp
===================================================================
--- branches/bmesh/blender/intern/ghost/intern/GHOST_EventManager.cpp	2011-04-15 01:43:30 UTC (rev 36175)
+++ branches/bmesh/blender/intern/ghost/intern/GHOST_EventManager.cpp	2011-04-15 02:13:37 UTC (rev 36176)
@@ -197,6 +197,9 @@
 }
 
 bool GHOST_EventManager::playingEvents(bool *hasevent) {
+	if (!m_playfile)
+		return false;
+	
 	if (hasevent && m_events.size()) {
 		GHOST_IEvent *event = m_events[m_events.size()-1];
 		GHOST_System *sys;
@@ -209,7 +212,7 @@
 	} else if (hasevent) 
 		*hasevent = true;
 	
-	return m_playfile != NULL;
+	return 1;
 }
 
 bool GHOST_EventManager::dispatchEvent()

Modified: branches/bmesh/blender/source/blender/bmesh/bmesh_error.h
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/bmesh_error.h	2011-04-15 01:43:30 UTC (rev 36175)
+++ branches/bmesh/blender/source/blender/bmesh/bmesh_error.h	2011-04-15 02:13:37 UTC (rev 36176)
@@ -32,11 +32,12 @@
 #define BMERR_SELF_INTERSECTING			1
 #define BMERR_DISSOLVEDISK_FAILED		2
 #define BMERR_CONNECTVERT_FAILED		3
-#define BMERR_WALKER_FAILED			4
+#define BMERR_WALKER_FAILED				4
 #define BMERR_DISSOLVEFACES_FAILED		5
 #define BMERR_DISSOLVEVERTS_FAILED		6
-#define BMERR_TESSELATION			7
-#define BMERR_NONMANIFOLD			8
+#define BMERR_TESSELATION				7
+#define BMERR_NONMANIFOLD				8
 #define BMERR_INVALID_SELECTION			9
+#define BMERR_MESH_ERROR				10
 
 #endif /* _BMESH_ERROR_H */

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mods.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mods.c	2011-04-15 01:43:30 UTC (rev 36175)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mods.c	2011-04-15 02:13:37 UTC (rev 36176)
@@ -56,7 +56,8 @@
 	}
 	
 	if (len == 1) {
-		BM_Kill_Edge(bm, v->e);
+		if (v->e) 
+			BM_Kill_Edge(bm, v->e);
 		BM_Kill_Vert(bm, v);
 		return 1;
 	}

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_newcore.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_newcore.c	2011-04-15 01:43:30 UTC (rev 36175)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_newcore.c	2011-04-15 02:13:37 UTC (rev 36176)
@@ -771,7 +771,7 @@
 
 #define FACE_MARK	(1<<10)
 
-static int count_flagged_radial(BMLoop *l, int flag)
+static int count_flagged_radial(BMesh *bm, BMLoop *l, int flag)
 {
 	BMLoop *l2 = l;
 	int i = 0, c=0;
@@ -779,19 +779,23 @@
 	do {
 		if (!l2) {
 			bmesh_error();
-			return 0;
+			goto error;
 		}
 		
 		i += bmesh_api_getflag(l2->f, flag) ? 1 : 0;
 		l2 = bmesh_radial_nextloop(l2);
 		if (c >= 800000) {
 			bmesh_error();
-			return 0;
+			goto error;
 		}
 		c++;
 	} while (l2 != l);
 
 	return i;
+
+error:
+	BMO_RaiseError(bm, bm->currentop, BMERR_MESH_ERROR, NULL);
+	return 0;
 }
 
 static int count_flagged_disk(BMVert *v, int flag)
@@ -874,7 +878,7 @@
 		f = faces[i];
 		l = bm_firstfaceloop(f);
 		do {
-			int rlen = count_flagged_radial(l, _FLAG_JF);
+			int rlen = count_flagged_radial(bm, l, _FLAG_JF);
 
 			if (rlen > 2) {
 				err = "Input faces do not form a contiguous manifold region";

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c	2011-04-15 01:43:30 UTC (rev 36175)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c	2011-04-15 02:13:37 UTC (rev 36176)
@@ -32,6 +32,7 @@
        "Tesselation error",
        "Can not deal with non-manifold geometry",
        "Invalid selection",
+	   "Internal mesh error",
 };
 
 

Modified: branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c	2011-04-15 01:43:30 UTC (rev 36175)
+++ branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c	2011-04-15 02:13:37 UTC (rev 36176)
@@ -1850,8 +1850,9 @@
 			
 		BLI_array_empty(stack);
 		BLI_array_append(stack, v);
+		BLI_array_append(dstack, 0.0f);
+
 		BLI_smallhash_insert(visit, (uintptr_t)v, NULL);		
-		BLI_array_append(dstack, 0.0f);
 		
 		while (BLI_array_count(stack)) {
 			BMIter eiter;
@@ -1860,15 +1861,16 @@
 			float d, d2, vec[3];
 			
 			v2 = BLI_array_pop(stack);
+			d = BLI_array_pop(dstack);
 			
-			d = dstack[BLI_array_count(dstack)-1]; 
-			BLI_array_pop(dstack);
-			
 			dists[BMINDEX_GET(v2)] = d;
 			BM_ITER(e, &eiter, em->bm, BM_EDGES_OF_VERT, v2) {
 				float d2;
 				v3 = BM_OtherEdgeVert(e, v2);
 				
+				if (BM_TestHFlag(v3, BM_SELECT) || BM_TestHFlag(v3, BM_HIDDEN))
+					continue;
+				
 				sub_v3_v3v3(vec, v2->co, v3->co);
 				mul_m3_v3(mtx, vec);
 				
@@ -1877,7 +1879,9 @@
 				if (d2 >= dists[BMINDEX_GET(v3)] && BLI_smallhash_haskey(visit, (uintptr_t)v3))
 					continue;
 				
-				BLI_smallhash_insert(visit, (uintptr_t)v3, NULL);
+				dists[BMINDEX_GET(v3)] = d2;
+				if (!BLI_smallhash_haskey(visit, (uintptr_t)v3))
+					BLI_smallhash_insert(visit, (uintptr_t)v3, NULL);
 				
 				BLI_array_append(stack, v3);
 				BLI_array_append(dstack, d2);




More information about the Bf-blender-cvs mailing list