[Bf-blender-cvs] [1b4cc8c5f35] temp-pbvh-split: Outliner: Remove 'rename library' feature.

Bastien Montagne noreply at git.blender.org
Fri Jun 3 01:16:29 CEST 2022


Commit: 1b4cc8c5f357e230f2c1d5e1782af7ce06edf035
Author: Bastien Montagne
Date:   Wed May 11 10:56:14 2022 +0200
Branches: temp-pbvh-split
https://developer.blender.org/rB1b4cc8c5f357e230f2c1d5e1782af7ce06edf035

Outliner: Remove 'rename library' feature.

This was historically the only way to change/fix paths of library files
in Blender. However, only changing the path then required a manual
reload of the library, which could be skipped by user, or a save/reload
of the working .blend file, which could lead to corruption of advanced
library usages like overrides.

Prefferred, modern way to change path of a library is to use the
Relocate operation instead. Direct path modification remains possible
through RNA (python console or the Data API view in the Outliner.

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

M	source/blender/editors/space_outliner/outliner_edit.cc
M	source/blender/editors/space_outliner/outliner_tools.cc

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

diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc
index d6c5901b546..1de45b0ec96 100644
--- a/source/blender/editors/space_outliner/outliner_edit.cc
+++ b/source/blender/editors/space_outliner/outliner_edit.cc
@@ -334,8 +334,16 @@ static void do_item_rename(ARegion *region,
       add_textbut = true;
     }
   }
-  else if (te->idcode == ID_LI && ((Library *)tselem->id)->parent) {
-    BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library");
+  else if (te->idcode == ID_LI) {
+    if (reinterpret_cast<Library *>(tselem->id)->parent) {
+      BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library");
+    }
+    else {
+      BKE_report(
+          reports,
+          RPT_WARNING,
+          "Library path is not editable from here anymore, please use Relocate operation instead");
+    }
   }
   else {
     add_textbut = true;
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index 5da64177e51..2ee1d28d540 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -2527,14 +2527,12 @@ void OUTLINER_OT_id_operation(wmOperatorType *ot)
 enum eOutlinerLibOpTypes {
   OL_LIB_INVALID = 0,
 
-  OL_LIB_RENAME,
   OL_LIB_DELETE,
   OL_LIB_RELOCATE,
   OL_LIB_RELOAD,
 };
 
 static const EnumPropertyItem outliner_lib_op_type_items[] = {
-    {OL_LIB_RENAME, "RENAME", 0, "Rename", ""},
     {OL_LIB_DELETE,
      "DELETE",
      ICON_X,
@@ -2566,14 +2564,6 @@ static int outliner_lib_operation_exec(bContext *C, wmOperator *op)
 
   eOutlinerLibOpTypes event = (eOutlinerLibOpTypes)RNA_enum_get(op->ptr, "type");
   switch (event) {
-    case OL_LIB_RENAME: {
-      outliner_do_libdata_operation(
-          C, op->reports, scene, space_outliner, &space_outliner->tree, item_rename_fn, nullptr);
-
-      WM_event_add_notifier(C, NC_ID | NA_EDITED, nullptr);
-      ED_undo_push(C, "Rename Library");
-      break;
-    }
     case OL_LIB_DELETE: {
       outliner_do_libdata_operation(
           C, op->reports, scene, space_outliner, &space_outliner->tree, id_delete_fn, nullptr);



More information about the Bf-blender-cvs mailing list