Blender
V4.3
source
blender
asset_system
intern
asset_library_essentials.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
9
#include "
BKE_appdir.hh
"
10
11
#include "
utils.hh
"
12
13
#include "
AS_essentials_library.hh
"
14
#include "
asset_library_essentials.hh
"
15
16
namespace
blender::asset_system
{
17
18
EssentialsAssetLibrary::EssentialsAssetLibrary
()
19
:
OnDiskAssetLibrary
(
ASSET_LIBRARY_ESSENTIALS
,
20
{},
21
utils::normalize_directory_path
(
essentials_directory_path
()))
22
{
23
import_method_ =
ASSET_IMPORT_APPEND_REUSE
;
24
}
25
26
StringRefNull
essentials_directory_path
()
27
{
28
static
std::string path = []() {
29
const
std::optional<std::string> datafiles_path =
BKE_appdir_folder_id
(
30
BLENDER_SYSTEM_DATAFILES
,
"assets"
);
31
return
datafiles_path.value_or(
""
);
32
}();
33
return
path;
34
}
35
36
}
// namespace blender::asset_system
AS_essentials_library.hh
BKE_appdir.hh
BLENDER_SYSTEM_DATAFILES
@ BLENDER_SYSTEM_DATAFILES
Definition
BKE_appdir.hh:173
BKE_appdir_folder_id
std::optional< std::string > BKE_appdir_folder_id(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
Definition
appdir.cc:704
ASSET_IMPORT_APPEND_REUSE
@ ASSET_IMPORT_APPEND_REUSE
Definition
DNA_asset_types.h:120
ASSET_LIBRARY_ESSENTIALS
@ ASSET_LIBRARY_ESSENTIALS
Definition
DNA_asset_types.h:102
asset_library_essentials.hh
utils.hh
blender::StringRefNull
Definition
BLI_string_ref.hh:111
blender::asset_system::EssentialsAssetLibrary::EssentialsAssetLibrary
EssentialsAssetLibrary()
Definition
asset_library_essentials.cc:18
blender::asset_system::OnDiskAssetLibrary
Definition
asset_library_on_disk.hh:15
blender::asset_system::utils::normalize_directory_path
std::string normalize_directory_path(StringRef directory)
Definition
asset_system/intern/utils.cc:17
blender::asset_system
Definition
AS_asset_catalog.hh:24
blender::asset_system::essentials_directory_path
StringRefNull essentials_directory_path()
Definition
asset_library_essentials.cc:26
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0