Asset Catalogs: allow creating catalog in unsaved blend file
Allow creating a new asset catalog in a yet-to-be-saved blend file. The problem was caused by `AssetLibrary` not having an `AssetCatalogService` right after creation; only after loading data from disk was this instance created. It's now always there.
This commit is contained in:
@@ -40,6 +40,7 @@ namespace blender::bke {
|
||||
struct AssetLibrary {
|
||||
std::unique_ptr<AssetCatalogService> catalog_service;
|
||||
|
||||
AssetLibrary();
|
||||
~AssetLibrary();
|
||||
|
||||
void load(StringRefNull library_root_directory);
|
||||
|
||||
@@ -102,6 +102,10 @@ void BKE_asset_library_refresh_catalog_simplename(struct AssetLibrary *asset_lib
|
||||
|
||||
namespace blender::bke {
|
||||
|
||||
AssetLibrary::AssetLibrary() : catalog_service(std::make_unique<AssetCatalogService>())
|
||||
{
|
||||
}
|
||||
|
||||
AssetLibrary::~AssetLibrary()
|
||||
{
|
||||
if (on_save_callback_store_.func) {
|
||||
|
||||
Reference in New Issue
Block a user