Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-10-27 19:25:29 +0300
committerJulian Eisel <julian@blender.org>2021-10-27 19:27:50 +0300
commit71adad288b02ae98608693d728843b5917f336e6 (patch)
tree74b732ed4a4311954431f48fc75daac0f50e1321 /source/blender/editors/asset
parentbca9ec767cd7a017a8cbe64ef0bd4b713b99a2b4 (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/asset')
-rw-r--r--source/blender/editors/asset/intern/asset_ops.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc
index 158e877ed7d..d2fd8ab88a4 100644
--- a/source/blender/editors/asset/intern/asset_ops.cc
+++ b/source/blender/editors/asset/intern/asset_ops.cc
@@ -427,7 +427,12 @@ static int asset_catalog_new_exec(bContext *C, wmOperator *op)
struct AssetLibrary *asset_library = ED_fileselect_active_asset_library_get(sfile);
char *parent_path = RNA_string_get_alloc(op->ptr, "parent_path", nullptr, 0, nullptr);
- ED_asset_catalog_add(asset_library, "Catalog", parent_path);
+ blender::bke::AssetCatalog *new_catalog = ED_asset_catalog_add(
+ asset_library, "Catalog", parent_path);
+
+ if (sfile) {
+ ED_fileselect_activate_asset_catalog(sfile, new_catalog->catalog_id);
+ }
MEM_freeN(parent_path);