diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-20 07:30:17 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-26 05:16:35 +0300 |
commit | 3f3d82cfe9cefe4bfd9da3d283dec4a1923ec22d (patch) | |
tree | 532de0110686d29f63c550c4784f8d2acc86e110 /source/blender/editors/include | |
parent | 11480763b62e6ca72ae869391b8e5495e57410a6 (diff) |
UI support for showing candidates for string properties
Currently strings are used for cases where a list of identifiers would
be useful to show.
Add support for string properties to reference a callback to populate
candidates to show when editing a string. The user isn't prevented from
typing in text not found in this list, it's just useful as a reference.
Support for expanding the following strings has been added:
- Operator, menu & panel identifiers in the keymap editor.
- WM operators that reference data-paths expand using the
Python-consoles auto-complete functionality.
- Names of keying sets for insert/delete keyframe operators.
Details:
- `bpy.props.StringProperty` takes an option `search` callback.
- A new string callback has been added, set via
`RNA_def_property_string_search_func` or
`RNA_def_property_string_search_func_runtime`.
- Addresses usability issue highlighted by T89560,
where setting keying set identifiers as strings isn't practical.
- Showing additional right-aligned text in the search results is
supported but disabled by default as the text is too cramped in most
string search popups where the feature would make sense. It could be
enabled as part of other layout tweaks.
Reviewed By: brecht
Ref D14986
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 6a730225da9..8c0147612fb 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -351,6 +351,19 @@ int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks); struct KeyingSet *ANIM_get_keyingset_for_autokeying(const struct Scene *scene, const char *transformKSName); +void ANIM_keyingset_visit_for_search(const struct bContext *C, + struct PointerRNA *ptr, + struct PropertyRNA *prop, + const char *edit_text, + StringPropertySearchVisitFunc visit_fn, + void *visit_user_data); + +void ANIM_keyingset_visit_for_search_no_poll(const struct bContext *C, + struct PointerRNA *ptr, + struct PropertyRNA *prop, + const char *edit_text, + StringPropertySearchVisitFunc visit_fn, + void *visit_user_data); /** * Dynamically populate an enum of Keying Sets. */ |