Fix #121410: Break liboverride hierarchies on Scene IDs.
This commit prevents considering Scenes (and a few other ID types, like WindowManager or Library) as being part of liboverride hierarchies. Having collections, objects, obdata etc. depend on a Scene ID is typically not considered as a valid setup for linked data. And in any case, Scenes are not officially supported for liboverrides currently. In the case of #121410, where a driver of the armature object was using the Scene ID, it will simply keep that scene reference pointing to the linked scene, instead of overriding the whole scene.
This commit is contained in:
@@ -911,6 +911,21 @@ static bool lib_override_hierarchy_dependencies_skip_check(ID *owner_id,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* Skip relationships to IDs that should not be involved in liboverrides currently.
|
||||
* NOTE: The Scene case is a bit specific:
|
||||
* - While not officially supported, API allow to create liboverrides of whole Scene.
|
||||
* - However, when creating liboverrides from other type of data (e.g. collections or
|
||||
* objects), scenes should really not be considered as part of a hierarchy. If there
|
||||
* are dependencies from other overridden IDs to a scene, this is considered as not
|
||||
* supported (see also #121410). */
|
||||
#define HIERARCHY_BREAKING_ID_TYPES ID_SCE, ID_LI, ID_SCR, ID_WM, ID_WS
|
||||
if (ELEM(GS(other_id->name), HIERARCHY_BREAKING_ID_TYPES) &&
|
||||
!ELEM(GS(owner_id->name), HIERARCHY_BREAKING_ID_TYPES))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#undef HIERARCHY_BREAKING_ID_TYPES
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user