This commit is contained in:
Jacques Lucke 2023-01-18 16:14:46 +01:00
parent 3bc5595d5a
commit cd9ab37373
5 changed files with 38 additions and 3 deletions

View File

@ -0,0 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup asset_system
*/
#pragma once
#include "BLI_string_ref.hh"
namespace blender::asset_system {
StringRefNull bundled_assets_directory_path();
}

View File

@ -14,6 +14,7 @@ set(INC_SYS
)
set(SRC
intern/asset_bundled.cc
intern/asset_catalog.cc
intern/asset_catalog_path.cc
intern/asset_catalog_tree.cc
@ -24,6 +25,7 @@ set(SRC
intern/asset_storage.cc
intern/utils.cc
AS_asset_bundled.hh
AS_asset_catalog.hh
AS_asset_catalog_path.hh
AS_asset_catalog_tree.hh

View File

@ -0,0 +1,16 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup asset_system
*/
#include "AS_asset_bundled.hh"
namespace blender::asset_system {
StringRefNull bundled_assets_directory_path()
{
return "/home/jacques/blender/build_release/bin/3.5/datafiles/assets/base_meshes";
}
} // namespace blender::asset_system

View File

@ -14,6 +14,7 @@
#include "CLG_log.h"
#include "AS_asset_bundled.hh"
#include "AS_asset_catalog_tree.hh"
#include "AS_asset_library.hh"
#include "asset_library_service.hh"
@ -61,8 +62,7 @@ AssetLibrary *AssetLibraryService::get_asset_library(
switch (type) {
case ASSET_LIBRARY_BUNDLED: {
const std::string root_path =
"/home/jacques/blender/build_release/bin/3.5/datafiles/assets/base_meshes";
const StringRefNull root_path = bundled_assets_directory_path();
return get_asset_library_on_disk(root_path);
}
case ASSET_LIBRARY_LOCAL: {

View File

@ -58,6 +58,8 @@
#include "UI_interface_icons.h"
#include "UI_view2d.h"
#include "AS_asset_bundled.hh"
#include "file_intern.h"
#include "filelist.h"
@ -427,7 +429,7 @@ static void fileselect_refresh_asset_params(FileAssetSelectParams *asset_params)
switch (eAssetLibraryType(library->type)) {
case ASSET_LIBRARY_BUNDLED:
BLI_strncpy(base_params->dir,
"/home/jacques/blender/build_release/bin/3.5/datafiles/assets/base_meshes",
blender::asset_system::bundled_assets_directory_path().c_str(),
sizeof(base_params->dir));
base_params->type = FILE_ASSET_LIBRARY;
break;