Cleanup: Remove unused asset C functions
This information can be retrieved from `AssetRepresentation` now. Also remove unnecessarily specific lambda capture. That usually suggests usage in `std::function` with a more complex lifetime.
This commit is contained in:
@@ -35,14 +35,8 @@ extern "C" {
|
||||
struct AssetHandle;
|
||||
|
||||
AssetRepresentationHandle *ED_asset_handle_get_representation(const struct AssetHandle *asset);
|
||||
ID_Type ED_asset_handle_get_id_type(const struct AssetHandle *asset);
|
||||
int ED_asset_handle_get_preview_icon_id(const struct AssetHandle *asset);
|
||||
int ED_asset_handle_get_preview_or_type_icon_id(const struct AssetHandle *asset);
|
||||
void ED_asset_handle_get_full_library_path(
|
||||
const struct AssetHandle *asset,
|
||||
/* `1024` for #FILE_MAX,
|
||||
* rely on warnings to let us know if this gets out of sync. */
|
||||
char r_full_lib_path[1024]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -30,11 +30,6 @@ blender::asset_system::AssetRepresentation *ED_asset_handle_get_representation(
|
||||
return asset->file_data->asset;
|
||||
}
|
||||
|
||||
ID_Type ED_asset_handle_get_id_type(const AssetHandle *asset_handle)
|
||||
{
|
||||
return asset_handle->file_data->asset->get_id_type();
|
||||
}
|
||||
|
||||
int ED_asset_handle_get_preview_icon_id(const AssetHandle *asset)
|
||||
{
|
||||
return asset->file_data->preview_icon_id;
|
||||
@@ -44,16 +39,3 @@ int ED_asset_handle_get_preview_or_type_icon_id(const AssetHandle *asset)
|
||||
{
|
||||
return ED_file_icon(asset->file_data);
|
||||
}
|
||||
|
||||
void ED_asset_handle_get_full_library_path(const AssetHandle *asset_handle,
|
||||
char r_full_lib_path[FILE_MAX])
|
||||
{
|
||||
*r_full_lib_path = '\0';
|
||||
|
||||
std::string library_path = asset_handle->file_data->asset->get_identifier().full_library_path();
|
||||
if (library_path.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
BLI_strncpy(r_full_lib_path, library_path.c_str(), FILE_MAX);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void AssetView::build_items()
|
||||
const bool show_names = (shelf_.settings.display_flag & ASSETSHELF_SHOW_NAMES);
|
||||
|
||||
const StringRef identifier = asset->get_identifier().library_relative_identifier();
|
||||
const int preview_id = [this, &asset_handle]() -> int {
|
||||
const int preview_id = [&]() -> int {
|
||||
if (ED_assetlist_asset_image_is_loading(&library_ref_, &asset_handle)) {
|
||||
return ICON_TEMP;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user