[Bf-blender-cvs] [4e5f9bbd347] master: Merge branch 'blender-v3.3-release'

Bastien Montagne noreply at git.blender.org
Fri Aug 12 15:17:23 CEST 2022


Commit: 4e5f9bbd34743b1a8183758e4dafc8e9a5662117
Author: Bastien Montagne
Date:   Fri Aug 12 15:17:12 2022 +0200
Branches: master
https://developer.blender.org/rB4e5f9bbd34743b1a8183758e4dafc8e9a5662117

Merge branch 'blender-v3.3-release'

Conflicts:
	source/blender/editors/space_outliner/outliner_tools.cc

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



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

diff --cc source/blender/editors/space_outliner/outliner_tools.cc
index c408eca654c,9a8bd15df85..1f74a3db0ff
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@@ -1191,45 -1304,54 +1304,54 @@@ static void id_override_library_resync_
  {
    BLI_assert(TSE_IS_REAL_ID(tselem));
    ID *id_root = tselem->id;
 -  OutlinerLibOverrideData *data = reinterpret_cast<OutlinerLibOverrideData *>(user_data);
 +  OutlinerLibOverrideData *data = static_cast<OutlinerLibOverrideData *>(user_data);
-   const bool do_hierarchy_enforce = data->do_resync_hierarchy_enforce;
  
-   if (ID_IS_OVERRIDE_LIBRARY_REAL(id_root)) {
-     Main *bmain = CTX_data_main(C);
+   if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root)) {
+     CLOG_WARN(&LOG, "Could not resync library override of data block '%s'", id_root->name);
+   }
  
-     id_root->tag |= LIB_TAG_DOIT;
+   if (id_root->override_library->hierarchy_root != nullptr) {
+     id_root = id_root->override_library->hierarchy_root;
+   }
  
-     /* Tag all linked parents in tree hierarchy to be also overridden. */
-     while ((te = te->parent) != nullptr) {
-       if (!TSE_IS_REAL_ID(te->store_elem)) {
-         continue;
-       }
-       if (!ID_IS_OVERRIDE_LIBRARY_REAL(te->store_elem->id)) {
-         break;
-       }
-       te->store_elem->id->tag |= LIB_TAG_DOIT;
-     }
+   data->id_root_set(id_root);
+ }
  
-     BlendFileReadReport report{};
-     report.reports = reports;
-     BKE_lib_override_library_resync(
-         bmain, scene, CTX_data_view_layer(C), id_root, nullptr, do_hierarchy_enforce, &report);
+ /* Resync a hierarchy of library overrides. */
+ static void id_override_library_resync_hierarchy_process(bContext *C,
+                                                          ReportList *reports,
+                                                          OutlinerLibOverrideData &data)
+ {
+   Main *bmain = CTX_data_main(C);
+   Scene *scene = CTX_data_scene(C);
+   const bool do_hierarchy_enforce = data.do_resync_hierarchy_enforce;
  
-     WM_event_add_notifier(C, NC_WINDOW, nullptr);
-   }
-   else {
-     CLOG_WARN(&LOG, "Could not resync library override of data block '%s'", id_root->name);
+   BlendFileReadReport report{};
+   report.reports = reports;
+ 
+   for (auto &&id_hierarchy_root : data.id_hierarchy_roots.keys()) {
+     BKE_lib_override_library_resync(bmain,
+                                     scene,
+                                     CTX_data_view_layer(C),
+                                     id_hierarchy_root,
+                                     nullptr,
+                                     do_hierarchy_enforce,
+                                     &report);
    }
+ 
+   WM_event_add_notifier(C, NC_WINDOW, nullptr);
  }
  
- static void id_override_library_clear_hierarchy_fn(bContext *C,
+ static void id_override_library_clear_hierarchy_fn(bContext *UNUSED(C),
                                                     ReportList *UNUSED(reports),
                                                     Scene *UNUSED(scene),
-                                                    TreeElement *te,
+                                                    TreeElement *UNUSED(te),
                                                     TreeStoreElem *UNUSED(tsep),
                                                     TreeStoreElem *tselem,
-                                                    void *UNUSED(user_data))
+                                                    void *user_data)
  {
+   OutlinerLibOverrideData *data = reinterpret_cast<OutlinerLibOverrideData *>(user_data);
+ 
    BLI_assert(TSE_IS_REAL_ID(tselem));
    ID *id_root = tselem->id;



More information about the Bf-blender-cvs mailing list