Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-12-23 12:10:05 +0300
committerBastien Montagne <bastien@blender.org>2021-12-23 12:13:07 +0300
commit00965c98cbf14871e822f9b0541caa8b09e0ad5e (patch)
treed9d7e38be542f2d73cdc87bdea2ba9e8b06ebd0c /source/blender
parent710e279b193fb61aeb279e826fc479200a1ba580 (diff)
LibOverride: protect better against using on complex inter-dependency cases.
Do not allow 3DView operator to run on the liboverride of an instantiating Empty object. And tweak behavior in the Outliner operations too. Related to T94226. Note that this remains fairly exotic, bad idea not recommended cases, such complex inter-dependencies between different libraries inside a same liboverride hierarchy is just not possible to handle properly.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/object/object_relations.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 71d9482597d..a6eb35d49b9 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2355,7 +2355,8 @@ static bool make_override_library_poll(bContext *C)
/* Object must be directly linked to be overridable. */
return (ED_operator_objectmode(C) && obact != NULL &&
(ID_IS_LINKED(obact) || (obact->instance_collection != NULL &&
- ID_IS_OVERRIDABLE_LIBRARY(obact->instance_collection))));
+ ID_IS_OVERRIDABLE_LIBRARY(obact->instance_collection) &&
+ !ID_IS_OVERRIDE_LIBRARY(obact))));
}
static const EnumPropertyItem *make_override_collections_of_linked_object_itemf(
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 01f0feec771..bcd455de9a4 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -817,7 +817,7 @@ static void id_override_library_create_fn(bContext *C,
ID *id_reference = NULL;
bool is_override_instancing_object = false;
if (tsep != NULL && tsep->type == TSE_SOME_ID && tsep->id != NULL &&
- GS(tsep->id->name) == ID_OB) {
+ GS(tsep->id->name) == ID_OB && !ID_IS_OVERRIDE_LIBRARY(tsep->id)) {
Object *ob = (Object *)tsep->id;
if (ob->type == OB_EMPTY && &ob->instance_collection->id == id_root) {
BLI_assert(GS(id_root->name) == ID_GR);