diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-17 17:09:28 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-17 17:09:28 +0300 |
commit | 8c9805fc628223984ad0c664b5a49b7f9eec0caa (patch) | |
tree | 3e7bf59bf86db2b94c90b30e287f9fd123940335 /source/blender/editors/space_outliner/outliner_tools.cc | |
parent | 939c2387a158722cafa84fc09f0eb13b67c603fe (diff) |
Revert "Outliner: Remove the 'Remap data-block usages' operation."
This reverts commit 30534deced8dad16c566dd82db3edd462283de13.
After discussion and feedback from users, it's better to keep this tool
available until there is time to properly re-think the whole Outliner's
contextual menu.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tools.cc')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index cb1f2bd7204..cc81d5ed68d 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -1700,6 +1700,7 @@ enum { OL_OP_SELECT = 1, OL_OP_DESELECT, OL_OP_SELECT_HIERARCHY, + OL_OP_REMAP, OL_OP_RENAME, }; @@ -1707,6 +1708,11 @@ static const EnumPropertyItem prop_object_op_types[] = { {OL_OP_SELECT, "SELECT", ICON_RESTRICT_SELECT_OFF, "Select", ""}, {OL_OP_DESELECT, "DESELECT", 0, "Deselect", ""}, {OL_OP_SELECT_HIERARCHY, "SELECT_HIERARCHY", 0, "Select Hierarchy", ""}, + {OL_OP_REMAP, + "REMAP", + 0, + "Remap Users", + "Make all users of selected data-blocks to use instead a new chosen one"}, {OL_OP_RENAME, "RENAME", 0, "Rename", ""}, {0, nullptr, 0, nullptr, nullptr}, }; @@ -1768,6 +1774,12 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op) str = "Deselect Objects"; selection_changed = true; break; + case OL_OP_REMAP: + outliner_do_libdata_operation( + C, op->reports, scene, space_outliner, &space_outliner->tree, id_remap_fn, nullptr); + /* No undo push here, operator does it itself (since it's a modal one, the op_undo_depth + * trick does not work here). */ + break; case OL_OP_RENAME: outliner_do_object_operation( C, op->reports, scene, space_outliner, &space_outliner->tree, item_rename_fn); @@ -1976,6 +1988,7 @@ enum eOutlinerIdOpTypes { OUTLINER_IDOP_OVERRIDE_LIBRARY_CLEAR_SINGLE, OUTLINER_IDOP_SINGLE, OUTLINER_IDOP_DELETE, + OUTLINER_IDOP_REMAP, OUTLINER_IDOP_COPY, OUTLINER_IDOP_PASTE, @@ -1993,6 +2006,11 @@ static const EnumPropertyItem prop_id_op_types[] = { {OUTLINER_IDOP_LOCAL, "LOCAL", 0, "Make Local", ""}, {OUTLINER_IDOP_SINGLE, "SINGLE", 0, "Make Single User", ""}, {OUTLINER_IDOP_DELETE, "DELETE", ICON_X, "Delete", ""}, + {OUTLINER_IDOP_REMAP, + "REMAP", + 0, + "Remap Users", + "Make all users of selected data-blocks to use instead current (clicked) one"}, {0, "", 0, nullptr, nullptr}, {OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE, "OVERRIDE_LIBRARY_CREATE", @@ -2411,6 +2429,15 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op) } break; } + case OUTLINER_IDOP_REMAP: { + if (idlevel > 0) { + outliner_do_libdata_operation( + C, op->reports, scene, space_outliner, &space_outliner->tree, id_remap_fn, nullptr); + /* No undo push here, operator does it itself (since it's a modal one, the op_undo_depth + * trick does not work here). */ + } + break; + } case OUTLINER_IDOP_COPY: { wm->op_undo_depth++; WM_operator_name_call(C, "OUTLINER_OT_id_copy", WM_OP_INVOKE_DEFAULT, nullptr, nullptr); |