diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-10-01 17:07:05 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-10-01 17:15:50 +0300 |
commit | f497e471f8663498596725c09702b5b6da39b707 (patch) | |
tree | b4af74592302908363a3b6638aa72818748c5a67 /source/blender/blenkernel/intern/asset_catalog.cc | |
parent | 3be4cb5b279165bb09df53f24f654f688a2f2e0f (diff) |
Asset Catalogs: always have an Asset Catalog Tree available
Always create an `AssetCatalogTree` in the `AssetCatalogService`. This
ensures that newly-created catalogs are immediately visible in the UI
(because they insert themselves into an already-existing tree).
Diffstat (limited to 'source/blender/blenkernel/intern/asset_catalog.cc')
-rw-r--r-- | source/blender/blenkernel/intern/asset_catalog.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/asset_catalog.cc b/source/blender/blenkernel/intern/asset_catalog.cc index 4973de20fb3..2c7cf28d60d 100644 --- a/source/blender/blenkernel/intern/asset_catalog.cc +++ b/source/blender/blenkernel/intern/asset_catalog.cc @@ -171,11 +171,8 @@ AssetCatalog *AssetCatalogService::create_catalog(const AssetCatalogPath &catalo catalog_definition_file_->add_new(catalog_ptr); } - /* The tree may not exist; this happens when no catalog definition file has been loaded yet. When - * the tree is created any in-memory catalogs will be added, so it doesn't need to happen now. */ - if (catalog_tree_) { - catalog_tree_->insert_item(*catalog_ptr); - } + BLI_assert_msg(catalog_tree_, "An Asset Catalog tree should always exist."); + catalog_tree_->insert_item(*catalog_ptr); return catalog_ptr; } |