[Bf-blender-cvs] [f3f0ea8dc27] master: Curve: Retain active NURBS curve after point deletion

Laurynas Duburas noreply at git.blender.org
Fri Oct 7 23:34:04 CEST 2022


Commit: f3f0ea8dc27e457f61667eb24c476646c46ae0a9
Author: Laurynas Duburas
Date:   Fri Oct 7 16:33:50 2022 -0500
Branches: master
https://developer.blender.org/rBf3f0ea8dc27e457f61667eb24c476646c46ae0a9

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

===================================================================

M	source/blender/editors/curve/editcurve.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list