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:
authorAntony Riakiotakis <kalast@gmail.com>2012-03-22 01:40:42 +0400
committerAntony Riakiotakis <kalast@gmail.com>2012-03-22 01:40:42 +0400
commit95f66f162ce695310872950232b6a00633646e1e (patch)
tree35d244d049192a07eedd2aae537a30361709c620 /source/blender/bmesh/intern/bmesh_walkers_impl.c
parentff7088088f63a2cfb4ab9b2219c29afe751dfed8 (diff)
Fix #30504 selecting self-intersecting face loop won't work correctly.
Added generic secondary hash to walker. In faceloop select it is used to remember if edge has been previously visited, in addition to the hash used for faces. This solves the case where walker stops if it finds an already added face.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_walkers_impl.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 8efcf9498f4..4821ec5edd2 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -594,7 +594,7 @@ static int bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l)
}
/* the face must not have been already visite */
- if (BLI_ghash_haskey(walker->visithash, l->f)) {
+ if (BLI_ghash_haskey(walker->visithash, l->f) && BLI_ghash_haskey(walker->secvisithash, l->e)) {
return FALSE;
}
@@ -652,6 +652,10 @@ static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data)
*lwalk = owalk;
lwalk->nocalc = 0;
+ BLI_ghash_free(walker->secvisithash, NULL, NULL);
+ walker->secvisithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 3");
+ BLI_ghash_insert(walker->visithash, lwalk->l->e, NULL);
+
BLI_ghash_free(walker->visithash, NULL, NULL);
walker->visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 3");
BLI_ghash_insert(walker->visithash, lwalk->l->f, NULL);
@@ -703,6 +707,7 @@ static void *bmw_FaceLoopWalker_step(BMWalker *walker)
lwalk->nocalc = 0;
}
+ BLI_ghash_insert(walker->secvisithash, l->e, NULL);
BLI_ghash_insert(walker->visithash, l->f, NULL);
}