diff options
author | Laurynas Duburas <laurynas> | 2022-10-08 00:33:50 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-08 00:33:50 +0300 |
commit | f3f0ea8dc27e457f61667eb24c476646c46ae0a9 (patch) | |
tree | 19e54ff8bb9629fc90878cd702739ac59f482bb7 /source | |
parent | d779792977d3b6bd941eb5359cb9d982b1d22458 (diff) |
Curve: Retain active NURBS curve after point deletion
Before, the active spline index and the active point index were always
cleared. Now the active index is only cleared when the curve/surface is
deleted. This was accomplished by making the surface patch delete
function handle that correctly. The spline deletion already handled it.
This fixes only vertex deletion mode.
Fixes problem mentioned in T101160.
Differential Revision: https://developer.blender.org/D16133
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index cb6652507ed..61e92f0a1c3 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1707,6 +1707,10 @@ static void ed_surf_delete_selected(Object *obedit) bp++; } if (a == 0) { + if (cu->actnu == BLI_findindex(editnurb, nu)) { + cu->actnu = CU_ACT_NONE; + } + BLI_remlink(editnurb, nu); keyIndex_delNurb(cu->editnurb, nu); BKE_nurb_free(nu); @@ -6483,6 +6487,7 @@ static int curve_delete_exec(bContext *C, wmOperator *op) } else if (type == CURVE_SEGMENT) { changed = curve_delete_segments(obedit, v3d, false); + cu->actnu = CU_ACT_NONE; } else { BLI_assert(0); @@ -6490,7 +6495,7 @@ static int curve_delete_exec(bContext *C, wmOperator *op) if (changed) { changed_multi = true; - cu->actnu = cu->actvert = CU_ACT_NONE; + cu->actvert = CU_ACT_NONE; if (ED_curve_updateAnimPaths(bmain, obedit->data)) { WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, obedit); |