diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2012-03-06 16:16:55 +0400 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2012-03-06 16:16:55 +0400 |
commit | bb21641e1ccfd85a64688c0846e68ee4cd335ea2 (patch) | |
tree | 4f9e2ff15facff4e7ecdf4552e390ec646dbe658 /source/blender/editors/mesh/knifetool.c | |
parent | d87f08cbaabe7d07f873adebd617747b3ae31bc4 (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/editors/mesh/knifetool.c')
-rw-r--r-- | source/blender/editors/mesh/knifetool.c | 31 |
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; |