Anim: do not set slot ID type when Action is linked

When an action slot does not have an ID type, and it is assigned to some
ID, the slot is bound to that ID's type. This now no longer happens when
the Action is linked, because linked data should not be modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/133670
This commit is contained in:
Sybren A. Stüvel
2025-01-27 16:29:18 +01:00
parent cc8c8c83a6
commit dd67b355ee
3 changed files with 61 additions and 1 deletions

View File

@@ -697,6 +697,13 @@ void Action::slot_identifier_ensure_prefix(Slot &slot)
void Action::slot_setup_for_id(Slot &slot, const ID &animated_id)
{
if (!ID_IS_EDITABLE(this) || ID_IS_OVERRIDE_LIBRARY(this)) {
/* Do not write to linked data. For now, also avoid changing the slot identifier on an
* override. Actions cannot have library overrides at the moment, and when they do, this should
* actually get designed. For now, it's better to avoid editing data than editing too much. */
return;
}
if (slot.has_idtype()) {
BLI_assert(slot.idtype == GS(animated_id.name));
return;