forked from blender/blender
Fix review comments #27
@ -43,20 +43,11 @@ std::string cache_image(Main *bmain,
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string image_name;
|
std::string image_name(std::to_string((uintptr_t)image));
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
image_name.append(default_format);
|
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);
|
STRNCPY(opts->filepath, tempfile);
|
||||||
|
|
||||||
if (!BKE_image_save(reports, bmain, image, iuser, opts)) {
|
if (!BKE_image_save(reports, bmain, image, iuser, opts)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user