37 if (temp_lib_context_) {
53 &bmain, blend_file_path.c_str(), id_type, asset_name, &reports);
55 if (temp_lib_context_ ==
nullptr || temp_lib_context_->
temp_id ==
nullptr) {
57 &reports,
RPT_ERROR,
"Unable to load %s from %s", asset_name, blend_file_path.c_str());
62 return temp_lib_context_->
temp_id;
71 return reinterpret_cast<AssetTempIDConsumer *
>(
72 MEM_new<AssetTemporaryIDConsumer>(__func__, asset));
86 if (!(consumer_ && bmain && reports)) {
94 return consumer->
import_id(id_type, *bmain, *reports);
Main runtime representation of an asset.
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
external readfile function prototypes.
TempLibraryContext * BLO_library_temp_load_id(Main *real_main, const char *blend_file_path, short idcode, const char *idname, ReportList *reports)
void BLO_library_temp_free(TempLibraryContext *temp_lib_ctx)
Read Guarded memory(de)allocation.
constexpr const char * c_str() const
std::string full_library_path() const
StringRefNull get_name() const
ID * import_id(ID_Type id_type, Main &bmain, ReportList &reports)
~AssetTemporaryIDConsumer()
AssetTemporaryIDConsumer(const asset_system::AssetRepresentation *asset)
AssetTempIDConsumer * temp_id_consumer_create(const blender::asset_system::AssetRepresentation *asset)
ID * temp_id_consumer_ensure_local_id(AssetTempIDConsumer *consumer, ID_Type id_type, Main *bmain, ReportList *reports)
void temp_id_consumer_free(AssetTempIDConsumer **consumer)