Fix review comments #27

Merged
Bogdan Nagirniak merged 14 commits from BLEN-392 into hydra-render 2023-04-21 15:02:44 +02:00
Showing only changes of commit 9168971d62 - Show all commits

View File

@ -43,20 +43,11 @@ std::string cache_image(Main *bmain,
return "";
}
std::string image_name;
if (image->source == IMA_SRC_GENERATED) {
image_name = pxr::TfMakeValidIdentifier(image_name.append(image->id.name + 2));
}
else {
image_name = image->filepath == NULL ? image->filepath : image->id.name + 2;
image_name = std::filesystem::path(image_name).filename().replace_extension().string();
image_name = pxr::TfMakeValidIdentifier(image_name);
}
std::string image_name(std::to_string((uintptr_t)image));
image_name.append(default_format);
BLI_path_join(tempfile, sizeof(tempfile), BKE_tempdir_session(), image_name.c_str());
BLI_path_join(tempfile, sizeof(tempfile), BKE_tempdir_session(), "hydra_image_cache", image_name.c_str());
STRNCPY(opts->filepath, tempfile);
if (!BKE_image_save(reports, bmain, image, iuser, opts)) {