[Bf-blender-cvs] [c7f74863dde] blender-v2.83-release: Fix T76711: override data-blocks could be renamed in the outliner

Philipp Oeser noreply at git.blender.org
Wed May 13 15:48:40 CEST 2020


Commit: c7f74863dde1a417e2742d3dadb4f5fd8bfc36af
Author: Philipp Oeser
Date:   Wed May 13 13:18:27 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBc7f74863dde1a417e2742d3dadb4f5fd8bfc36af

Fix T76711: override data-blocks could be renamed in the outliner

Overriding datablock should never have an editable name.

This also moves the check for linked/overridden datablocks above the
check for master-collection (otherwise a linked/overriden collection
could still be renamed)

Maniphest Tasks: T76711

Differential Revision: https://developer.blender.org/D7718

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

M	source/blender/editors/space_outliner/outliner_edit.c

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

diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 469a0065e3a..181be13f959 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -352,6 +352,12 @@ static void do_item_rename(ARegion *region,
   else if (ELEM(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
     BKE_report(reports, RPT_WARNING, "Cannot edit sequence name");
   }
+  else if (ID_IS_LINKED(tselem->id)) {
+    BKE_report(reports, RPT_WARNING, "Cannot edit external library data");
+  }
+  else if (ID_IS_OVERRIDE_LIBRARY(tselem->id)) {
+    BKE_report(reports, RPT_WARNING, "Cannot edit name of an override data-block");
+  }
   else if (outliner_is_collection_tree_element(te)) {
     Collection *collection = outliner_collection_from_tree_element(te);
 
@@ -362,9 +368,6 @@ static void do_item_rename(ARegion *region,
       add_textbut = true;
     }
   }
-  else if (ID_IS_LINKED(tselem->id)) {
-    BKE_report(reports, RPT_WARNING, "Cannot edit external library data");
-  }
   else if (te->idcode == ID_LI && ((Library *)tselem->id)->parent) {
     BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library");
   }



More information about the Bf-blender-cvs mailing list