diff options
author | Julian Eisel <julian@blender.org> | 2021-08-11 15:20:49 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-08-11 15:32:07 +0300 |
commit | 62cb5c5c4aacc3f83fa5053e4fb5fc4524522fe7 (patch) | |
tree | d3117fdb720eb36cdb16aeb06c29bea89174bfe0 /source/blender/editors/space_file | |
parent | 48ba341d151206a5acfd3c945a9c9ef183c3d0a6 (diff) |
Enable Asset Browser by default for poses, rest stays experimental
Idea for 3.0 is to disable all functionality that isn't well polished
and focus on those parts first. Starting with poses.
* Adds a new experimental option "Extended Asset Browser", replacing
"Asset Browser".
* Unlike the previous option, this isn't enabled by default anymore.
This didn't work well in practice and caused plenty of confusion.
* "Mark as Asset" and "Clear Asset" are hidden if the option is
disabled.
* Same for the category selection in the Asset Browser.
* Always show display the "Only Assets" option in the File Browser while
browing inside .blend files. That way you can hide data-blocks that
are not pose assets.
* The Asset Library setup UI in the Preferences is always visible now,
it's needed for pose library access.
Addresses T90181, T90180 and T90300.
Differential Revision: https://developer.blender.org/D12120
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 0b3349f5751..7deaa2fec60 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -1,4 +1,4 @@ -/* +/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -334,6 +334,12 @@ static void file_refresh(const bContext *C, ScrArea *area) sfile->files = filelist_new(params->type); params->highlight_file = -1; /* added this so it opens nicer (ton) */ } + + if (!U.experimental.use_extended_asset_browser && ED_fileselect_is_asset_browser(sfile)) { + /* Only poses supported as non-experimental right now. */ + params->filter_id = FILTER_ID_AC; + } + filelist_settype(sfile->files, params->type); filelist_setdir(sfile->files, params->dir); filelist_setrecursion(sfile->files, params->recursion_level); @@ -575,6 +581,16 @@ static void file_main_region_message_subscribe(const wmRegionMessageSubscribePar /* All properties for this space type. */ WM_msg_subscribe_rna(mbus, &ptr, NULL, &msg_sub_value_area_tag_refresh, __func__); } + + /* Experimental Asset Browser features option. */ + { + PointerRNA ptr; + RNA_pointer_create(NULL, &RNA_PreferencesExperimental, &U.experimental, &ptr); + PropertyRNA *prop = RNA_struct_find_property(&ptr, "use_extended_asset_browser"); + + /* All properties for this space type. */ + WM_msg_subscribe_rna(mbus, &ptr, prop, &msg_sub_value_area_tag_refresh, __func__); + } } static bool file_main_region_needs_refresh_before_draw(SpaceFile *sfile) @@ -852,13 +868,7 @@ static void file_space_subtype_item_extend(bContext *UNUSED(C), EnumPropertyItem **item, int *totitem) { - 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); - } + RNA_enum_items_add(item, totitem, rna_enum_space_file_browse_mode_items); } static const char *file_context_dir[] = { |