Keymap: remove internal vert_without_handles option

This was needed while testing #96544, now all curve picking selects
bezier knots without handles - the option can be removed.

This is a functional change for the 2.7x keymap, however selecting
bezier points with handles isn't a useful difference to keep.
This commit is contained in:
Campbell Barton 2023-09-08 16:40:59 +10:00
parent 773fb27d96
commit 45305a5ad1
5 changed files with 14 additions and 39 deletions

@ -568,7 +568,6 @@ def _template_items_tool_select(
# Always use the cursor operator where possible,
# needed for time-line views where we always want to be able to scrub time.
cursor_prioritize=False,
operator_props=(),
fallback=False,
):
if not params.legacy and not fallback:
@ -585,11 +584,11 @@ def _template_items_tool_select(
if select_passthrough:
return [
(operator, {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("deselect_all", True), ("select_passthrough", True), *operator_props]}),
{"properties": [("deselect_all", True), ("select_passthrough", True)]}),
(operator, {"type": 'LEFTMOUSE', "value": 'CLICK'},
{"properties": [("deselect_all", True), *operator_props]}),
{"properties": [("deselect_all", True)]}),
(operator, {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("deselect_all", False), ("toggle", True), *operator_props]}),
{"properties": [("deselect_all", False), ("toggle", True)]}),
("transform.translate", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
{"properties": [("release_confirm", True)]}),
]
@ -600,9 +599,9 @@ def _template_items_tool_select(
# unless it is expected that the tool should operate on the selection (click-drag to rip for e.g.).
return [
(operator, {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("deselect_all", True), *operator_props]}),
{"properties": [("deselect_all", True)]}),
(operator, {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("toggle", True), *operator_props]}),
{"properties": [("toggle", True)]}),
# Fallback key-map must transform as the primary tool is expected
# to be accessed via gizmos in this case. See: #96885.
@ -4886,10 +4885,6 @@ def _template_view3d_select(*, type, value, legacy, select_passthrough, exclude_
# NOTE: `exclude_mod` is needed since we don't want this tool to exclude Control-RMB actions when this is used
# as a tool key-map with RMB-select and `use_fallback_tool` is enabled with RMB select. See #92467.
props_vert_without_handles = ()
if select_passthrough:
props_vert_without_handles = ("vert_without_handles",)
# See: `use_tweak_select_passthrough` doc-string.
if select_passthrough and (value in {'CLICK', 'RELEASE'}):
select_passthrough = False
@ -4899,9 +4894,9 @@ def _template_view3d_select(*, type, value, legacy, select_passthrough, exclude_
{"type": type, "value": value, **{m: True for m in mods}},
{"properties": [(c, True) for c in props]},
) for props, mods in (
((("deselect_all", "select_passthrough", *props_vert_without_handles) if select_passthrough else
("deselect_all", *props_vert_without_handles)) if not legacy else (), ()),
(("toggle", *props_vert_without_handles), ("shift",)),
((("deselect_all", "select_passthrough") if select_passthrough else
("deselect_all",)) if not legacy else (), ()),
(("toggle",), ("shift",)),
(("center", "object"), ("ctrl",)),
(("enumerate",), ("alt",)),
(("toggle", "center"), ("shift", "ctrl")),
@ -4918,7 +4913,7 @@ def _template_view3d_select(*, type, value, legacy, select_passthrough, exclude_
{"type": type, "value": 'CLICK'},
{"properties": [
(c, True)
for c in ("deselect_all", *props_vert_without_handles)
for c in ("deselect_all",)
]},
))
@ -7074,17 +7069,12 @@ def km_3d_view_tool_text_select(_params):
def km_3d_view_tool_select(params, *, fallback):
if params.use_tweak_select_passthrough:
operator_props = (("vert_without_handles", True),)
else:
operator_props = ()
return (
_fallback_id("3D View Tool: Tweak", fallback),
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
*([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select(
params, "view3d.select", "view3d.cursor3d", operator_props=operator_props, fallback=fallback)),
params, "view3d.select", "view3d.cursor3d", fallback=fallback)),
*([] if params.use_fallback_tool_select_handled else
_template_view3d_select(
type=params.select_mouse,

@ -4789,7 +4789,6 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
bool ED_curve_editnurb_select_pick(bContext *C,
const int mval[2],
const int dist_px,
const bool vert_without_handles,
const SelectPick_Params *params)
{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
@ -4805,8 +4804,7 @@ bool ED_curve_editnurb_select_pick(bContext *C,
ED_view3d_viewcontext_init(C, &vc, depsgraph);
copy_v2_v2_int(vc.mval, mval);
const bool use_handle_select = vert_without_handles &&
(vc.v3d->overlay.handle_display != CURVE_HANDLE_NONE);
const bool use_handle_select = (vc.v3d->overlay.handle_display != CURVE_HANDLE_NONE);
bool found = ED_curve_pick_vert_ex(&vc, true, dist_px, &nu, &bezt, &bp, &hand, &basact);

@ -1667,7 +1667,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event)
else if (ELEM(event->type, LEFTMOUSE)) {
if (ELEM(event->val, KM_RELEASE, KM_DBL_CLICK)) {
if (delete_point && !cpd->new_point && !cpd->dragging) {
if (ED_curve_editnurb_select_pick(C, event->mval, threshold_dist_px, true, &params)) {
if (ED_curve_editnurb_select_pick(C, event->mval, threshold_dist_px, &params)) {
cpd->changed = delete_point_under_mouse(&vc, event);
}
}
@ -1728,7 +1728,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
}
else if (select_point) {
ED_curve_editnurb_select_pick(C, event->mval, threshold_dist_px, true, &params);
ED_curve_editnurb_select_pick(C, event->mval, threshold_dist_px, &params);
}
}

@ -47,12 +47,10 @@ void ED_curve_editnurb_free(Object *obedit);
/**
* \param dist_px: Maximum distance to pick (in pixels).
* \param vert_without_handles: When true, selecting the knot doesn't select the handles.
*/
bool ED_curve_editnurb_select_pick(bContext *C,
const int mval[2],
int dist_px,
bool vert_without_handles,
const SelectPick_Params *params);
Nurb *ED_curve_add_nurbs_primitive(

@ -3276,7 +3276,6 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
SelectPick_Params params{};
ED_select_pick_params_from_operator(op->ptr, &params);
const bool vert_without_handles = RNA_boolean_get(op->ptr, "vert_without_handles");
bool center = RNA_boolean_get(op->ptr, "center");
bool enumerate = RNA_boolean_get(op->ptr, "enumerate");
/* Only force object select for edit-mode to support vertex parenting,
@ -3336,8 +3335,7 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
changed = ED_lattice_select_pick(C, mval, &params);
}
else if (ELEM(obedit->type, OB_CURVES_LEGACY, OB_SURF)) {
changed = ED_curve_editnurb_select_pick(
C, mval, ED_view3d_select_dist_px(), vert_without_handles, &params);
changed = ED_curve_editnurb_select_pick(C, mval, ED_view3d_select_dist_px(), &params);
}
else if (obedit->type == OB_MBALL) {
changed = ED_mball_select_pick(C, mval, &params);
@ -3424,15 +3422,6 @@ void VIEW3D_OT_select(wmOperatorType *ot)
ot->srna, "object", false, "Object", "Use object selection (edit mode only)");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
/* Needed for select-through to usefully drag handles, see: #98254.
* NOTE: this option may be removed and become default behavior, see design task: #98552. */
prop = RNA_def_boolean(ot->srna,
"vert_without_handles",
false,
"Control Point Without Handles",
"Only select the curve control point, not its handles");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_int_vector(ot->srna,
"location",
2,