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:
authorHoward Trickey <howard.trickey@gmail.com>2012-03-06 16:16:55 +0400
committerHoward Trickey <howard.trickey@gmail.com>2012-03-06 16:16:55 +0400
commitbb21641e1ccfd85a64688c0846e68ee4cd335ea2 (patch)
tree4f9e2ff15facff4e7ecdf4552e390ec646dbe658 /source/blender
parentd87f08cbaabe7d07f873adebd617747b3ae31bc4 (diff)
Fix to knifetool when intermediate point in space.
Before, if you cut the same edge multiple times with an intermediate point in space, it wouldn't get all of the edges.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/mesh/knifetool.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/source/blender/editors/mesh/knifetool.c b/source/blender/editors/mesh/knifetool.c
index c1bd0db5a8f..205e1d3e90e 100644
--- a/source/blender/editors/mesh/knifetool.c
+++ b/source/blender/editors/mesh/knifetool.c
@@ -697,12 +697,12 @@ static void knife_add_cut(knifetool_opdata *kcd)
if (len_v3v3(kcd->vertcage, lh->realhit) < FLT_EPSILON * 80)
continue;
- if (kcd->prev_is_space || kcd->is_space) {
- kcd->prev_is_space = kcd->is_space = 0;
+ if (kcd->prev_is_space) {
+ kcd->prev_is_space = 0;
copy_v3_v3(kcd->prevco, lh->hit);
copy_v3_v3(kcd->prevcage, lh->cagehit);
kcd->prevedge = lh->kfe;
- kcd->curbmface = lh->f;
+ kcd->prevbmface = lh->f;
continue;
}
@@ -716,14 +716,23 @@ static void knife_add_cut(knifetool_opdata *kcd)
knife_add_single_cut(kcd);
}
- kcd->curbmface = oldkcd.curbmface;
- kcd->curvert = oldkcd.curvert;
- kcd->curedge = oldkcd.curedge;
- kcd->is_space = oldkcd.is_space;
- copy_v3_v3(kcd->vertco, oldkcd.vertco);
- copy_v3_v3(kcd->vertcage, oldkcd.vertcage);
-
- knife_add_single_cut(kcd);
+ if (oldkcd.is_space) {
+ kcd->prevbmface = oldkcd.curbmface;
+ kcd->prevvert = oldkcd.curvert;
+ kcd->prevedge = oldkcd.curedge;
+ copy_v3_v3(kcd->prevco, oldkcd.vertco);
+ copy_v3_v3(kcd->prevcage, oldkcd.vertcage);
+ kcd->prev_is_space = oldkcd.is_space;
+ } else {
+ kcd->curbmface = oldkcd.curbmface;
+ kcd->curvert = oldkcd.curvert;
+ kcd->curedge = oldkcd.curedge;
+ kcd->is_space = oldkcd.is_space;
+ copy_v3_v3(kcd->vertco, oldkcd.vertco);
+ copy_v3_v3(kcd->vertcage, oldkcd.vertcage);
+
+ knife_add_single_cut(kcd);
+ }
MEM_freeN(kcd->linehits);
kcd->linehits = NULL;