[Bf-blender-cvs] [7c9e4099854] master: Outliner ID Remap Users: hide ID type from the UI

Philipp Oeser noreply at git.blender.org
Fri Dec 17 13:58:56 CET 2021


Commit: 7c9e4099854a4fc8eab4db97173c1aacd25f9e08
Author: Philipp Oeser
Date:   Wed Dec 8 12:45:56 2021 +0100
Branches: master
https://developer.blender.org/rB7c9e4099854a4fc8eab4db97173c1aacd25f9e08

Outliner ID Remap Users: hide ID type from the UI

The correct type should be set by invoke already, changing it to a non-
matching type (e.g. trying to remap Mesh users with a Camera block) does
not really make sense afaict, reason being that we would be presented
with the "Invalid old/new ID pair" message in such case anyways (code
checks GS(old_id->name) == GS(new_id->name)).

This alone wouldnt be a pressing issue, but since doing this with an
object ID type crashes atm., it seems to make sense to clean this up now
(of course the crash should be looked into, but this is for a separate
patch -- if that is solved, we could also think about adding the "Remap
Users" entry back in the context menu for objects as well [which was
removed in rB17bd5c9d4b1e for some reason]).

Part of T93799.

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

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

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 9d4b14a1f57..97e5c046452 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -703,6 +703,8 @@ void OUTLINER_OT_id_remap(wmOperatorType *ot)
 
   prop = RNA_def_enum(ot->srna, "id_type", rna_enum_id_type_items, ID_OB, "ID Type", "");
   RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID);
+  /* Changing ID type wont make sense, would return early with "Invalid old/new ID pair" anyways. */
+  RNA_def_property_flag(prop, PROP_HIDDEN);
 
   prop = RNA_def_enum(ot->srna, "old_id", DummyRNA_NULL_items, 0, "Old ID", "Old ID to replace");
   RNA_def_property_enum_funcs_runtime(prop, NULL, NULL, outliner_id_itemf);



More information about the Bf-blender-cvs mailing list