Blender
V3.3
|
#include "BKE_asset_catalog.hh"
#include "BKE_asset_library.hh"
#include "BKE_main.h"
#include "BLI_string_utils.h"
#include "ED_asset_catalog.h"
#include "ED_asset_catalog.hh"
#include "WM_api.h"
Go to the source code of this file.
Classes | |
struct | CatalogUniqueNameFnData |
Functions | |
static bool | catalog_name_exists_fn (void *arg, const char *name) |
static std::string | catalog_name_ensure_unique (AssetCatalogService &catalog_service, StringRefNull name, StringRef parent_path) |
AssetCatalog * | ED_asset_catalog_add (::AssetLibrary *library, StringRefNull name, StringRef parent_path) |
void | ED_asset_catalog_remove (::AssetLibrary *library, const CatalogID &catalog_id) |
void | ED_asset_catalog_rename (::AssetLibrary *library, const CatalogID catalog_id, const StringRefNull new_name) |
void | ED_asset_catalog_move (::AssetLibrary *library, const CatalogID src_catalog_id, const std::optional< CatalogID > dst_parent_catalog_id) |
void | ED_asset_catalogs_save_from_main_path (::AssetLibrary *library, const Main *bmain) |
void | ED_asset_catalogs_set_save_catalogs_when_file_is_saved (const bool should_save) |
bool | ED_asset_catalogs_get_save_catalogs_when_file_is_saved () |
|
static |
Definition at line 33 of file editors/asset/intern/asset_catalog.cc.
References BLI_uniquename_cb(), blender::StringRefNull::c_str(), catalog_name_exists_fn(), MAX_NAME, and unique_name().
Referenced by ED_asset_catalog_add(), and ED_asset_catalog_move().
Definition at line 26 of file editors/asset/intern/asset_catalog.cc.
References CatalogUniqueNameFnData::catalog_service, blender::bke::AssetCatalogService::find_catalog_by_path(), and CatalogUniqueNameFnData::parent_path.
Referenced by catalog_name_ensure_unique().
AssetCatalog* ED_asset_catalog_add | ( | ::AssetLibrary * | library, |
StringRefNull | name, | ||
StringRef | parent_path | ||
) |
Definition at line 46 of file editors/asset/intern/asset_catalog.cc.
References BKE_asset_library_get_catalog_service(), catalog_name_ensure_unique(), blender::bke::AssetCatalogService::create_catalog(), library, NC_SPACE, ND_SPACE_ASSET_PARAMS, blender::bke::AssetCatalogService::tag_has_unsaved_changes(), blender::bke::AssetCatalogService::undo_push(), unique_name(), and WM_main_add_notifier().
void ED_asset_catalog_move | ( | ::AssetLibrary * | library, |
const CatalogID | src_catalog_id, | ||
const std::optional< CatalogID > | dst_parent_catalog_id | ||
) |
Definition at line 109 of file editors/asset/intern/asset_catalog.cc.
References BKE_asset_library_get_catalog_service(), BLI_assert_unreachable, blender::bke::AssetCatalogPath::c_str(), catalog_name_ensure_unique(), blender::bke::AssetCatalogPath::cleanup(), blender::bke::AssetCatalogService::find_catalog(), library, blender::bke::AssetCatalogPath::name(), NC_SPACE, ND_SPACE_ASSET_PARAMS, blender::bke::AssetCatalog::path, blender::bke::AssetCatalogService::tag_has_unsaved_changes(), blender::bke::AssetCatalogService::undo_push(), unique_name(), blender::bke::AssetCatalogService::update_catalog_path(), and WM_main_add_notifier().
void ED_asset_catalog_remove | ( | ::AssetLibrary * | library, |
const CatalogID & | catalog_id | ||
) |
Definition at line 69 of file editors/asset/intern/asset_catalog.cc.
References BKE_asset_library_get_catalog_service(), BLI_assert_unreachable, library, NC_SPACE, ND_SPACE_ASSET_PARAMS, blender::bke::AssetCatalogService::prune_catalogs_by_id(), blender::bke::AssetCatalogService::tag_has_unsaved_changes(), blender::bke::AssetCatalogService::undo_push(), and WM_main_add_notifier().
void ED_asset_catalog_rename | ( | ::AssetLibrary * | library, |
const CatalogID | catalog_id, | ||
const StringRefNull | new_name | ||
) |
Definition at line 83 of file editors/asset/intern/asset_catalog.cc.
References BKE_asset_library_get_catalog_service(), BLI_assert_unreachable, blender::bke::AssetCatalogPath::cleanup(), blender::bke::AssetCatalogService::find_catalog(), library, NC_SPACE, ND_SPACE_ASSET_PARAMS, blender::bke::AssetCatalogPath::parent(), blender::bke::AssetCatalog::path, blender::bke::AssetCatalogService::tag_has_unsaved_changes(), blender::bke::AssetCatalogService::undo_push(), blender::bke::AssetCatalogService::update_catalog_path(), and WM_main_add_notifier().
Definition at line 170 of file editors/asset/intern/asset_catalog.cc.
References blender::bke::AssetLibrary::save_catalogs_when_file_is_saved.
Referenced by block_create__close_file_dialog().
void ED_asset_catalogs_save_from_main_path | ( | ::AssetLibrary * | library, |
const Main * | bmain | ||
) |
Definition at line 151 of file editors/asset/intern/asset_catalog.cc.
References BKE_asset_library_get_catalog_service(), BLI_assert_unreachable, Main::filepath, library, blender::bke::AssetCatalogService::undo_push(), and blender::bke::AssetCatalogService::write_to_disk().
Definition at line 165 of file editors/asset/intern/asset_catalog.cc.
References blender::bke::AssetLibrary::save_catalogs_when_file_is_saved.
Referenced by save_catalogs_when_file_is_closed_set_fn().