Blender V4.5
essentials_library.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BKE_appdir.hh"
10
11#include "utils.hh"
12
14#include "essentials_library.hh"
15
16namespace blender::asset_system {
17
25
26std::optional<AssetLibraryReference> EssentialsAssetLibrary::library_reference() const
27{
28 AssetLibraryReference library_ref{};
29 library_ref.custom_library_index = -1;
30 library_ref.type = ASSET_LIBRARY_ESSENTIALS;
31 return library_ref;
32}
33
35{
36 static std::string path = []() {
37 const std::optional<std::string> datafiles_path = BKE_appdir_folder_id(
38 BLENDER_SYSTEM_DATAFILES, "assets");
39 return datafiles_path.value_or("");
40 }();
41 return path;
42}
43
44} // namespace blender::asset_system
@ BLENDER_SYSTEM_DATAFILES
std::optional< std::string > BKE_appdir_folder_id(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
Definition appdir.cc:717
@ ASSET_IMPORT_APPEND_REUSE
@ ASSET_LIBRARY_ESSENTIALS
std::optional< AssetLibraryReference > library_reference() const override
OnDiskAssetLibrary(eAssetLibraryType library_type, StringRef name="", StringRef root_path="")
std::string normalize_directory_path(StringRef directory)
StringRefNull essentials_directory_path()