From f497e471f8663498596725c09702b5b6da39b707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 1 Oct 2021 16:07:05 +0200 Subject: 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). --- source/blender/blenkernel/intern/asset_catalog.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/asset_catalog.cc') 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; } -- cgit v1.2.3