36 if (temp_lib_context_) {
43 return asset_->local_id();
48 const char *asset_name = asset_->get_name().c_str();
49 std::string blend_file_path = asset_->full_library_path();
52 &bmain, blend_file_path.c_str(), id_type, asset_name, &
reports);
54 if (temp_lib_context_ ==
nullptr || temp_lib_context_->temp_id ==
nullptr) {
56 &
reports,
RPT_ERROR,
"Unable to load %s from %s", asset_name, blend_file_path.c_str());
60 BLI_assert(
GS(temp_lib_context_->temp_id->name) == id_type);
61 return temp_lib_context_->temp_id;
70 return reinterpret_cast<AssetTempIDConsumer *
>(
71 MEM_new<AssetTemporaryIDConsumer>(__func__,
asset));
85 if (!(consumer_ && 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.
NonCopyable(const NonCopyable &other)=delete
NonMovable(NonMovable &&other)=delete
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)