Fix: Applying active keying set from menu not working

When a keying set is enabled and the keying set option
"Active Keying Set" was chosen from the menu, it would
give an error.

That is because the active keyingset uses a special
ID string (`"__ACTIVE__"`)
that doesn't actually exist as a keying set.
To fix it, explicitly check against that string and return
the active if encountered.

Pull Request: https://projects.blender.org/blender/blender/pulls/116192
This commit is contained in:
Christoph Lendenfeld
2024-01-25 16:59:48 +01:00
committed by Christoph Lendenfeld
parent d05d6f500b
commit 1ea97dde6d

View File

@@ -1381,7 +1381,13 @@ static KeyingSet *keyingset_get_from_op_with_error(wmOperator *op, PropertyRNA *
else if (prop_type == PROP_STRING) {
char type_id[MAX_ID_NAME - 2];
RNA_property_string_get(op->ptr, prop, type_id);
ks = ANIM_keyingset_get_from_idname(scene, type_id);
if (strcmp(type_id, "__ACTIVE__") == 0) {
ks = ANIM_keyingset_get_from_enum_type(scene, scene->active_keyingset);
}
else {
ks = ANIM_keyingset_get_from_idname(scene, type_id);
}
if (ks == nullptr) {
BKE_reportf(op->reports, RPT_ERROR, "Keying set '%s' not found", type_id);