diff options
author | Julian Eisel <julian@blender.org> | 2021-10-27 19:25:29 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-10-27 19:27:50 +0300 |
commit | 71adad288b02ae98608693d728843b5917f336e6 (patch) | |
tree | 74b732ed4a4311954431f48fc75daac0f50e1321 /source/blender/editors/space_file/filesel.c | |
parent | bca9ec767cd7a017a8cbe64ef0bd4b713b99a2b4 (diff) |
Asset Browser: Activate catalog after adding
Adding a catalog should also activate it, like we do it for adding other
data in Blender. The tree-view code will make sure the newly added item
will not have collapsed parents.
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 5299b8ba580..11757975a62 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -483,6 +483,18 @@ struct ID *ED_fileselect_active_asset_get(const SpaceFile *sfile) return filelist_file_get_id(file); } +void ED_fileselect_activate_asset_catalog(const SpaceFile *sfile, const bUUID catalog_id) +{ + if (!ED_fileselect_is_asset_browser(sfile)) { + return; + } + + FileAssetSelectParams *params = ED_fileselect_get_asset_params(sfile); + params->asset_catalog_visibility = FILE_SHOW_ASSETS_FROM_CATALOG; + params->catalog_id = catalog_id; + WM_main_add_notifier(NC_SPACE | ND_SPACE_ASSET_PARAMS, NULL); +} + static void on_reload_activate_by_id(SpaceFile *sfile, onReloadFnData custom_data) { ID *asset_id = (ID *)custom_data; |