Fix #144371: Prevent inserting keyframes on linked action

When action is linked/overridden, it should not be editable. In this
situation, exit early from `insert_keyframes` to avoid inserting keys on
linked ID.

Pull Request: https://projects.blender.org/blender/blender/pulls/144416
This commit is contained in:
Pratik Borhade
2025-08-19 10:10:41 +02:00
committed by Pratik Borhade
parent 3a6a663a15
commit 1b5c896346

View File

@@ -1030,6 +1030,13 @@ CombinedKeyingResult insert_keyframes(Main *bmain,
return combined_result;
}
if (const bAction *action = adt->action) {
if (ID_IS_LINKED(action) || ID_IS_OVERRIDE_LIBRARY(action)) {
combined_result.add(SingleKeyingResult::ID_NOT_EDITABLE, rna_paths.size());
return combined_result;
}
}
bAction *dna_action = id_action_ensure(bmain, id);
BLI_assert(dna_action != nullptr);
Action &action = dna_action->wrap();