Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2011-04-15 06:13:37 +0400
committerJoseph Eagar <joeedh@gmail.com>2011-04-15 06:13:37 +0400
commit005b37643d2cc59f55f91fc776810d9925a526c7 (patch)
tree1f427a8eddf9c65169fa1a75b0e075bf7de9556a /source
parentc98148a963d37fc2f25e125afeb4cf21df6fbf14 (diff)
fixed idling problem
Diffstat (limited to 'source')
-rw-r--r--source/blender/bmesh/bmesh_error.h7
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c3
-rw-r--r--source/blender/bmesh/intern/bmesh_newcore.c12
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.c1
-rw-r--r--source/blender/editors/transform/transform_conversions.c14
5 files changed, 24 insertions, 13 deletions
diff --git a/source/blender/bmesh/bmesh_error.h b/source/blender/bmesh/bmesh_error.h
index 482de844cd4..3482402b45b 100644
--- a/source/blender/bmesh/bmesh_error.h
+++ b/source/blender/bmesh/bmesh_error.h
@@ -32,11 +32,12 @@ int BMO_CatchOpError(BMesh *bm, BMOperator *catchop, int errorcode, char **msg);
#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 */
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index 68be8e8127b..45547a60c44 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -56,7 +56,8 @@ int BM_Dissolve_Vert(BMesh *bm, BMVert *v) {
}
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;
}
diff --git a/source/blender/bmesh/intern/bmesh_newcore.c b/source/blender/bmesh/intern/bmesh_newcore.c
index 82f83c0bbb9..611b6937fbc 100644
--- a/source/blender/bmesh/intern/bmesh_newcore.c
+++ b/source/blender/bmesh/intern/bmesh_newcore.c
@@ -771,7 +771,7 @@ void bmesh_clear_systag_elements(BMesh *UNUSED(bm), void *veles, int tot, int fl
#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 @@ static int count_flagged_radial(BMLoop *l, int flag)
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 @@ BMFace *BM_Join_Faces(BMesh *bm, BMFace **faces, int totface)
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";
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index 27c545b4f79..bdb69f974d2 100644
--- a/source/blender/bmesh/intern/bmesh_operators.c
+++ b/source/blender/bmesh/intern/bmesh_operators.c
@@ -32,6 +32,7 @@ static const char *bmop_error_messages[] = {
"Tesselation error",
"Can not deal with non-manifold geometry",
"Invalid selection",
+ "Internal mesh error",
};
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 2b308ffeb70..418f6c194e6 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1850,8 +1850,9 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
BLI_array_empty(stack);
BLI_array_append(stack, v);
- BLI_smallhash_insert(visit, (uintptr_t)v, NULL);
BLI_array_append(dstack, 0.0f);
+
+ BLI_smallhash_insert(visit, (uintptr_t)v, NULL);
while (BLI_array_count(stack)) {
BMIter eiter;
@@ -1860,15 +1861,16 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
float d, d2, vec[3];
v2 = BLI_array_pop(stack);
-
- d = dstack[BLI_array_count(dstack)-1];
- BLI_array_pop(dstack);
+ d = 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 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
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);