[Bf-blender-cvs] [841beea2013] soc-2021-knife-tools: Knife: Fixed undo when cut is on edge
Cian Jinks
noreply at git.blender.org
Sun Jul 18 14:55:57 CEST 2021
Commit: 841beea20134cfe11b9fcfeaf16099e0f43177a4
Author: Cian Jinks
Date: Sun Jul 18 13:53:23 2021 +0100
Branches: soc-2021-knife-tools
https://developer.blender.org/rB841beea20134cfe11b9fcfeaf16099e0f43177a4
Knife: Fixed undo when cut is on edge
Fixed undo with cut segments along mesh edges and cut segments not over a mesh.
Cut segments along a mesh edge also no longer show as they are redundant.
===================================================================
M source/blender/editors/mesh/editmesh_knife.c
===================================================================
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 926336ca7fa..2b9c2feb89d 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1639,12 +1639,9 @@ static void knife_add_single_cut(KnifeTool_OpData *kcd,
return;
}
- /* If the cut is on an edge, just tag that its a cut and return. */
+ /* If the cut is on an edge. */
if ((lh1->v && lh2->v) && (lh1->v->v && lh2->v && lh2->v->v) &&
(e_base = BM_edge_exists(lh1->v->v, lh2->v->v))) {
- kfe = get_bm_knife_edge(kcd, e_base);
- kfe->is_cut = true;
- kfe->e = e_base;
return;
}
if (knife_add_single_cut__is_linehit_outside_face(f, lh1, lh2->hit) ||
@@ -3414,16 +3411,14 @@ static void knifetool_undo(KnifeTool_OpData *kcd)
}
}
- if (lastkfe) {
- /* Restore data for distance and angle measurements. */
- kcd->mdata = undo->mdata;
-
- if (kcd->mode == MODE_DRAGGING) {
- /* Restore kcd->prev. */
- kcd->prev = undo->pos;
- }
+ if (kcd->mode == MODE_DRAGGING) {
+ /* Restore kcd->prev. */
+ kcd->prev = undo->pos;
}
+ /* Restore data for distance and angle measurements. */
+ kcd->mdata = undo->mdata;
+
BLI_stack_discard(kcd->undostack);
}
}
More information about the Bf-blender-cvs
mailing list