UI: Move Mark/Clear asset out of ID Data in Outliner context menu

They are now always shown in the top-level of the Outliner context menu.
Having them in the ID Data submenu was just a hassle to work with, and
often confusing to users - even if technically correct (the asset status
is part of the ID data).

Part of T82680.
This commit is contained in:
2021-07-30 19:37:11 +02:00
parent a9ea310d30
commit 96fb21f3af
2 changed files with 21 additions and 15 deletions

View File

@@ -1747,8 +1747,6 @@ typedef enum eOutlinerIdOpTypes {
OUTLINER_IDOP_INVALID = 0,
OUTLINER_IDOP_UNLINK,
OUTLINER_IDOP_MARK_ASSET,
OUTLINER_IDOP_CLEAR_ASSET,
OUTLINER_IDOP_LOCAL,
OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE,
OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY,
@@ -1775,8 +1773,6 @@ typedef enum eOutlinerIdOpTypes {
/* TODO: implement support for changing the ID-block used. */
static const EnumPropertyItem prop_id_op_types[] = {
{OUTLINER_IDOP_UNLINK, "UNLINK", 0, "Unlink", ""},
{OUTLINER_IDOP_MARK_ASSET, "MARK_ASSET", 0, "Mark Asset", ""},
{OUTLINER_IDOP_CLEAR_ASSET, "CLEAR_ASSET", 0, "Clear Asset", ""},
{OUTLINER_IDOP_LOCAL, "LOCAL", 0, "Make Local", ""},
{OUTLINER_IDOP_SINGLE, "SINGLE", 0, "Make Single User", ""},
{OUTLINER_IDOP_DELETE, "DELETE", ICON_X, "Delete", ""},
@@ -1859,9 +1855,6 @@ static bool outliner_id_operation_item_poll(bContext *C,
}
switch (enum_value) {
case OUTLINER_IDOP_MARK_ASSET:
case OUTLINER_IDOP_CLEAR_ASSET:
return U.experimental.use_asset_browser;
case OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE:
if (ID_IS_OVERRIDABLE_LIBRARY(tselem->id)) {
return true;
@@ -2016,14 +2009,6 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
}
break;
}
case OUTLINER_IDOP_MARK_ASSET: {
WM_operator_name_call(C, "ASSET_OT_mark", WM_OP_EXEC_DEFAULT, NULL);
break;
}
case OUTLINER_IDOP_CLEAR_ASSET: {
WM_operator_name_call(C, "ASSET_OT_clear", WM_OP_EXEC_DEFAULT, NULL);
break;
}
case OUTLINER_IDOP_LOCAL: {
/* make local */
outliner_do_libdata_operation(