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:
authorCampbell Barton <ideasman42@gmail.com>2012-04-20 14:52:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-20 14:52:13 +0400
commit3d851bfd5bf4fd486d8e9b8baec3d184dd4be939 (patch)
tree20bfe9c682351b8997e9b9890481b7bd9e7702cd /source/blender/editors/mesh/editmesh_bvh.c
parent80ff1984f87dc44e984edb5b84e41f769fa64fee (diff)
knife tool modifications
from user freedback it seems there are 2 use cases, both valid. * Select geometry and cut the selection in half (as 2.4x worked) * Point-to-point define the faces to cut, dont cut through everything (only cut what you see). With the second, since you are already selecting the edges to cut and snapping to them. only cutting the selecting is limiting/annoying. Modifying these options while the knife tool runs doesn't work well, so expose under 2 keys, K, Shift-K.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_bvh.c')
-rw-r--r--source/blender/editors/mesh/editmesh_bvh.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_bvh.c b/source/blender/editors/mesh/editmesh_bvh.c
index 8be0cc0aa36..6155ad1be1c 100644
--- a/source/blender/editors/mesh/editmesh_bvh.c
+++ b/source/blender/editors/mesh/editmesh_bvh.c
@@ -104,8 +104,16 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit)
tree->bm = em->bm;
tree->epsilon = FLT_EPSILON * 2.0f;
tree->flag = flag;
-
- if (flag & BMBVH_RESPECT_HIDDEN) {
+
+ if (flag & (BMBVH_RESPECT_SELECT)) {
+ tottri = 0;
+ for (i = 0; i < em->tottri; i++) {
+ if (BM_elem_flag_test(em->looptris[i][0]->f, BM_ELEM_SELECT)) {
+ tottri++;
+ }
+ }
+ }
+ else if (flag & (BMBVH_RESPECT_HIDDEN)) {
tottri = 0;
for (i = 0; i < em->tottri; i++) {
if (!BM_elem_flag_test(em->looptris[i][0]->f, BM_ELEM_HIDDEN)) {
@@ -146,7 +154,14 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit)
for (i = 0; i < em->tottri; i++) {
- if (flag & BMBVH_RESPECT_HIDDEN) {
+
+ if (flag & BMBVH_RESPECT_SELECT) {
+ /* note, the arrays wont allign now! take care */
+ if (!BM_elem_flag_test(em->looptris[i][0]->f, BM_ELEM_SELECT)) {
+ continue;
+ }
+ }
+ else if (flag & BMBVH_RESPECT_HIDDEN) {
/* note, the arrays wont allign now! take care */
if (BM_elem_flag_test(em->looptris[i][0]->f, BM_ELEM_HIDDEN)) {
continue;