Curves: support adding keymap items for operators

* Add a new keymap for `curves.*` operators. This is mainly for
  edit mode operators, but since we don't have edit mode yet,
  these operators are also exposed in sculpt mode currently.
* Fix the naming of the "sculpt curves" keymap.
This commit is contained in:
Jacques Lucke 2022-06-14 10:53:06 +02:00
parent c654a92237
commit e903403b41
2 changed files with 16 additions and 1 deletions

View File

@ -5588,6 +5588,17 @@ def km_font(params):
return keymap
# Curves edit mode.
def km_curves(params):
items = []
keymap = (
"Curves",
{"space_type": 'EMPTY', "region_type": 'WINDOW'},
{"items": items},
)
return keymap
def km_sculpt_curves(params):
items = []
@ -8013,6 +8024,7 @@ def generate_keymaps(params=None):
km_lattice(params),
km_particle(params),
km_font(params),
km_curves(params),
km_sculpt_curves(params),
km_object_non_modal(params),

View File

@ -270,7 +270,10 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
break;
}
}
else if (STRPREFIX(opname, "CURVES_SCULPT_OT")) {
else if (STRPREFIX(opname, "CURVES_OT")) {
km = WM_keymap_find_all(wm, "Curves", 0, 0);
}
else if (STRPREFIX(opname, "SCULPT_CURVES_OT")) {
km = WM_keymap_find_all(wm, "Sculpt Curves", 0, 0);
}
else if (STRPREFIX(opname, "MBALL_OT")) {