Files
test/source/blender/asset_system/intern/asset_library_essentials.cc
Julian Eisel 3c2366d313 Assets: Add further dedicated derived classes for asset libraries
Continuation of bdfb1f6a04. Adds derived classes for the essentials and
preferences asset libraries, to allow specialized classes with a simple
and common interface. This should help untangling the asset library
service code.
2024-02-06 16:11:32 +01:00

37 lines
927 B
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup asset_system
*/
#include "BKE_appdir.hh"
#include "utils.hh"
#include "AS_essentials_library.hh"
#include "asset_library_essentials.hh"
namespace blender::asset_system {
EssentialsAssetLibrary::EssentialsAssetLibrary()
: OnDiskAssetLibrary(ASSET_LIBRARY_ESSENTIALS,
{},
utils::normalize_directory_path(essentials_directory_path()))
{
import_method_ = ASSET_IMPORT_APPEND_REUSE;
}
StringRefNull essentials_directory_path()
{
static std::string path = []() {
const std::optional<std::string> datafiles_path = BKE_appdir_folder_id(BLENDER_DATAFILES,
"assets");
return datafiles_path.value_or("");
}();
return path;
}
} // namespace blender::asset_system