[Bf-blender-cvs] [c3757504233] blender-v3.3-release: Fix T100476: Shift click to create overrides on objects not working.

Bastien Montagne noreply at git.blender.org
Thu Aug 18 12:27:10 CEST 2022


Commit: c3757504233ab7b1dca7102bb9239423d6419efc
Author: Bastien Montagne
Date:   Thu Aug 18 12:24:54 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBc3757504233ab7b1dca7102bb9239423d6419efc

Fix T100476: Shift click to create overrides on objects not working.

Case where object was directly linked and not owned by a linked
collection was not properly handled, added some level of support for it
now.

Note that the behavior may not always be ideal in cases where the linked
object would be linked in many different local collecitons, hard to get
best solution always from this Editor given limited hierarchy data
available here.

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

M	source/blender/editors/interface/interface_templates.c

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

diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 35e368bc6d6..bec4506ca41 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -683,7 +683,7 @@ ID *ui_template_id_liboverride_hierarchy_create(
    * NOTE: do not attempt to perform such hierarchy override at all cost, if there is not enough
    * context, better to abort than create random overrides all over the place. */
   if (!ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(id)) {
-    RNA_warning("The data-block %s is not direclty overridable", id->name);
+    RNA_warning("The data-block %s is not overridable", id->name);
     return NULL;
   }
 
@@ -789,6 +789,15 @@ ID *ui_template_id_liboverride_hierarchy_create(
         BKE_lib_override_library_create(
             bmain, scene, view_layer, NULL, id, &collection_active->id, NULL, &id_override, false);
       }
+      else {
+        if (object_active != NULL) {
+          object_active->id.tag |= LIB_TAG_DOIT;
+        }
+        BKE_lib_override_library_create(
+            bmain, scene, view_layer, NULL, id, NULL, NULL, &id_override, false);
+        BKE_scene_collections_object_remove(bmain, scene, (Object *)id, true);
+        WM_event_add_notifier(C, NC_ID | NA_REMOVED, NULL);
+      }
       break;
     case ID_ME:
     case ID_CU_LEGACY:



More information about the Bf-blender-cvs mailing list