26 std::unique_ptr<AssetMetaData> metadata,
28 : owner_asset_library_(owner_asset_library),
29 relative_identifier_(relative_asset_path),
37 : owner_asset_library_(owner_asset_library),
38 relative_identifier_(relative_asset_path),
42 throw std::invalid_argument(
"Passed ID is not an asset");
48 return AssetWeakReference::make_reference(owner_asset_library_, relative_identifier_);
56 return std::get<ExternalAsset>(asset_).name;
64 return ID_Type(std::get<ExternalAsset>(asset_).id_type);
70 return *
id->asset_data;
72 return *std::get<ExternalAsset>(asset_).metadata_;
77 return relative_identifier_;
86 relative_identifier_.c_str());
94 char blend_path[1090 ];
122 return this->
is_local_id() ? std::get<ID *>(asset_) :
nullptr;
127 return std::holds_alternative<ID *>(asset_);
132 return owner_asset_library_;
Main runtime representation of an asset.
bool BKE_blendfile_library_path_explode(const char *path, char *r_dir, char **r_group, char **r_name)
#define BLI_path_join(...)
ID and Library types, which are fundamental for SDNA.
constexpr const char * c_str() const
std::optional< eAssetImportMethod > import_method_
bool may_override_import_method_
StringRefNull root_path() const
std::string full_path() const
AssetMetaData & get_metadata() const
const AssetLibrary & owner_asset_library() const
ID_Type get_id_type() const
AssetRepresentation(StringRef relative_asset_path, StringRef name, int id_type, std::unique_ptr< AssetMetaData > metadata, const AssetLibrary &owner_asset_library)
StringRefNull library_relative_identifier() const
AssetWeakReference make_weak_reference() const
std::string full_library_path() const
bool get_use_relative_path() const
std::optional< eAssetImportMethod > get_import_method() const
StringRefNull get_name() const
bool may_override_import_method() const