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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mods.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index 89516061f91..9a99d5b96d1 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -152,14 +152,14 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
return TRUE;
}
else if (keepedge == NULL && len == 2) {
- /* collapse the verte */
+ /* collapse the vertex */
e = BM_vert_collapse_faces(bm, v->e, v, 1.0, TRUE, TRUE);
if (!e) {
return FALSE;
}
- /* handle two-valenc */
+ /* handle two-valence */
f = e->l->f;
f2 = e->l->radial_next->f;
@@ -205,12 +205,12 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v)
return FALSE;
}
- /* get remaining two face */
+ /* get remaining two faces */
f = e->l->f;
f2 = e->l->radial_next->f;
if (f != f2) {
- /* join two remaining face */
+ /* join two remaining faces */
if (!BM_faces_join_pair(bm, f, f2, e, TRUE)) {
return FALSE;
}
@@ -343,7 +343,7 @@ BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l
BLI_assert(v1 != v2);
- /* do we have a multires layer */
+ /* do we have a multires layer? */
if (has_mdisp) {
of = BM_face_copy(bm, f, FALSE, FALSE);
}
@@ -641,7 +641,6 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
BMFace **oldfaces = NULL;
BMEdge *e_dummy;
BLI_array_staticdeclare(oldfaces, 32);
- SmallHash hash;
const int do_mdisp = (e->l && CustomData_has_layer(&bm->ldata, CD_MDISPS));
/* we need this for handling multi-res */
@@ -649,7 +648,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
r_e = &e_dummy;
}
- /* do we have a multi-res layer */
+ /* do we have a multi-res layer? */
if (do_mdisp) {
BMLoop *l;
int i;
@@ -660,12 +659,11 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
l = l->radial_next;
} while (l != e->l);
- /* create a hash so we can differentiate oldfaces from new face */
- BLI_smallhash_init(&hash);
-
+ /* flag existing faces so we can differentiate oldfaces from new faces */
for (i = 0; i < BLI_array_count(oldfaces); i++) {
+ BM_ELEM_API_FLAG_ENABLE(oldfaces[i], _FLAG_OVERLAP);
oldfaces[i] = BM_face_copy(bm, oldfaces[i], TRUE, TRUE);
- BLI_smallhash_insert(&hash, (intptr_t)oldfaces[i], NULL);
+ BM_ELEM_API_FLAG_DISABLE(oldfaces[i], _FLAG_OVERLAP);
}
}
@@ -689,7 +687,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
if (do_mdisp) {
int i, j;
- /* interpolate new/changed loop data from copied old face */
+ /* interpolate new/changed loop data from copied old faces */
for (j = 0; j < 2; j++) {
for (i = 0; i < BLI_array_count(oldfaces); i++) {
BMEdge *e1 = j ? *r_e : e;
@@ -703,7 +701,8 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
}
do {
- if (!BLI_smallhash_haskey(&hash, (intptr_t)l->f)) {
+ /* check this is an old face */
+ if (BM_ELEM_API_FLAG_TEST(l->f, _FLAG_OVERLAP)) {
BMLoop *l2_first;
l2 = l2_first = BM_FACE_FIRST_LOOP(l->f);
@@ -716,7 +715,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
}
}
- /* destroy the old face */
+ /* destroy the old faces */
for (i = 0; i < BLI_array_count(oldfaces); i++) {
BM_face_verts_kill(bm, oldfaces[i]);
}
@@ -741,7 +740,6 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
#endif
BLI_array_free(oldfaces);
- BLI_smallhash_release(&hash);
}
return nv;