diff options
Diffstat (limited to 'source/blender/editors')
4 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/editors/asset/asset_ops.c b/source/blender/editors/asset/asset_ops.c index 929d49e19fa..29c3174f051 100644 --- a/source/blender/editors/asset/asset_ops.c +++ b/source/blender/editors/asset/asset_ops.c @@ -26,8 +26,10 @@ #include "BLI_listbase.h" #include "BLI_string_utils.h" +#include "BLI_utildefines.h" #include "DNA_asset_types.h" +#include "DNA_userdef_types.h" #include "ED_asset.h" @@ -47,6 +49,11 @@ struct AssetMarkResultStats { ID *last_id; }; +static bool asset_ops_poll(bContext *UNUSED(C)) +{ + return U.experimental.use_asset_browser; +} + /** * Return the IDs to operate on as list of #CollectionPointerLink links. Needs freeing. */ @@ -146,6 +153,7 @@ static void ASSET_OT_mark(wmOperatorType *ot) ot->idname = "ASSET_OT_mark"; ot->exec = asset_mark_exec; + ot->poll = asset_ops_poll; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -225,6 +233,7 @@ static void ASSET_OT_clear(wmOperatorType *ot) ot->idname = "ASSET_OT_clear"; ot->exec = asset_clear_exec; + ot->poll = asset_ops_poll; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index 09e3d39c603..24a9558d095 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -954,7 +954,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) } /* If the button reprents an id, it can set the "id" context pointer. */ - if (ED_asset_can_make_single_from_context(C)) { + if (U.experimental.use_asset_browser && ED_asset_can_make_single_from_context(C)) { ID *id = CTX_data_pointer_get_type(C, "id", &RNA_ID).data; /* Gray out items depending on if data-block is an asset. Preferably this could be done via diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 774dc54700c..aedc6228355 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -776,7 +776,13 @@ static void file_space_subtype_item_extend(bContext *UNUSED(C), EnumPropertyItem **item, int *totitem) { - RNA_enum_items_add(item, totitem, rna_enum_space_file_browse_mode_items); + if (U.experimental.use_asset_browser) { + RNA_enum_items_add(item, totitem, rna_enum_space_file_browse_mode_items); + } + else { + RNA_enum_items_add_value( + item, totitem, rna_enum_space_file_browse_mode_items, FILE_BROWSE_MODE_FILES); + } } static const char *file_context_dir[] = {"active_file", "active_id", NULL}; diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index f6d6e771801..2a2803c58dd 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -1791,6 +1791,9 @@ static bool outliner_id_operation_item_poll(bContext *C, SpaceOutliner *space_outliner = CTX_wm_space_outliner(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: case OUTLINER_IDOP_OVERRIDE_LIBRARY_CREATE_HIERARCHY: return true; |