[Bf-blender-cvs] [00965c98cbf] master: LibOverride: protect better against using on complex inter-dependency cases.

Bastien Montagne noreply at git.blender.org
Thu Dec 23 10:13:12 CET 2021


Commit: 00965c98cbf14871e822f9b0541caa8b09e0ad5e
Author: Bastien Montagne
Date:   Thu Dec 23 10:10:05 2021 +0100
Branches: master
https://developer.blender.org/rB00965c98cbf14871e822f9b0541caa8b09e0ad5e

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.

===================================================================

M	source/blender/editors/object/object_relations.c
M	source/blender/editors/space_outliner/outliner_tools.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list