UI: Asset Shelf (Experimental Feature) #104831

Closed
Julian Eisel wants to merge 399 commits from asset-shelf into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
7 changed files with 7 additions and 17 deletions
Showing only changes of commit 59a1394435 - Show all commits

View File

@ -34,10 +34,6 @@ class AssetIdentifier {
std::string full_path() const;
std::string full_library_path() const;
/**
* Get the identifier to locate the asset within the asset library.
*/
StringRefNull relative_path() const;
};
} // namespace blender::asset_system

View File

@ -114,7 +114,7 @@ class AssetRepresentation {
/* C-Handle */
struct AssetRepresentation;
const blender::StringRefNull AS_asset_representation_relative_path_get(
const blender::StringRefNull AS_asset_representation_library_relative_identifier_get(
const AssetRepresentation *asset_handle);
std::string AS_asset_representation_full_path_get(const ::AssetRepresentation *asset);
/**

View File

@ -49,9 +49,4 @@ std::string AssetIdentifier::full_library_path() const
return blend_path;
}
StringRefNull AssetIdentifier::relative_path() const
{
return relative_asset_path_;
}
} // namespace blender::asset_system

View File

@ -135,13 +135,13 @@ const AssetLibrary &AssetRepresentation::owner_asset_library() const
using namespace blender;
const StringRefNull AS_asset_representation_relative_path_get(
const StringRefNull AS_asset_representation_library_relative_identifier_get(
const AssetRepresentation *asset_handle)
{
const asset_system::AssetRepresentation *asset =
reinterpret_cast<const asset_system::AssetRepresentation *>(asset_handle);
const asset_system::AssetIdentifier &identifier = asset->get_identifier();
return identifier.relative_path();
return identifier.library_relative_identifier();
}
std::string AS_asset_representation_full_path_get(const AssetRepresentation *asset_handle)

View File

@ -50,6 +50,6 @@ bool ED_asset_handle_get_use_relative_path(const struct AssetHandle *asset);
std::optional<eAssetImportMethod> ED_asset_handle_get_import_method(
const struct AssetHandle *asset);
blender::StringRefNull ED_asset_handle_get_relative_path(const AssetHandle &asset);
blender::StringRefNull ED_asset_handle_get_library_relative_identifier(const AssetHandle &asset);
#endif

View File

@ -57,9 +57,9 @@ std::optional<eAssetImportMethod> ED_asset_handle_get_import_method(
return AS_asset_representation_import_method_get(asset_handle->file_data->asset);
}
blender::StringRefNull ED_asset_handle_get_relative_path(const AssetHandle &asset)
blender::StringRefNull ED_asset_handle_get_library_relative_identifier(const AssetHandle &asset)
{
return AS_asset_representation_relative_path_get(asset.file_data->asset);
return AS_asset_representation_library_relative_identifier_get(asset.file_data->asset);
}
void ED_asset_handle_get_full_library_path(const AssetHandle *asset_handle,

View File

@ -120,8 +120,7 @@ void AssetView::build_items()
const bool show_names = (shelf_.settings.display_flag & ASSETSHELF_SHOW_NAMES);
/* Use the path within the library as identifier, this should be unique. */
const StringRef identifier = ED_asset_handle_get_relative_path(asset);
const StringRef identifier = ED_asset_handle_get_library_relative_identifier(asset);
const StringRef name = show_names ? ED_asset_handle_get_name(&asset) : "";
const int preview_id = ED_asset_handle_get_preview_icon_id(&asset);