Keyframing: add operators that use keying-set ID's

Unfortunately we can't use insert/delete_keyframe operators in keymaps
because the enums aren't known at the time of keymap registration
and the keying sets are dynamic and use a poll function.

Add a version of insert/delete operators that takes a string
instead of an enum. Needed for D4626.

Also extract int to keying-set into a utility function.
This commit is contained in:
2019-04-10 11:27:32 +02:00
parent 99f1e3d57f
commit 1a12c9edab
5 changed files with 164 additions and 29 deletions

View File

@@ -229,6 +229,10 @@ struct KeyingSet *ANIM_get_keyingset_for_autokeying(struct Scene *scene, const c
/* Dynamically populate an enum of Keying Sets */
const struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free);
/* Use to get the keying set from the int value used by enums. */
KeyingSet *ANIM_keyingset_get_from_enum_type(struct Scene *scene, int type);
KeyingSet *ANIM_keyingset_get_from_idname(struct Scene *scene, const char *idname);
/* Check if KeyingSet can be used in the current context */
bool ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks);