Fix review comments #27

Merged
Bogdan Nagirniak merged 14 commits from BLEN-392 into hydra-render 2023-04-21 15:02:44 +02:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit 51473dd21b - Show all commits

View File

@ -109,7 +109,7 @@ def export_mtlx(material):
if not doc:
return ""
mtlx_file = mx_utils.get_temp_file(".mtlx", str(material.as_pointer()))
mtlx_file = mx_utils.get_temp_file(".mtlx", f"mat_{material.as_pointer():016x}")
mx_utils.export_to_file(doc, mtlx_file, export_deps=True, copy_deps=False)
return str(mtlx_file)

View File

@ -34,8 +34,7 @@ std::string cache_image(Main *bmain,
ImageSaveOptions *opts,
ReportList *reports)
{
const std::string default_format = ".png";
const char *default_format = ".png";
char tempfile[FILE_MAX];
if (!BKE_image_save_options_init(opts, bmain, scene, image, iuser, true, false)) {
@ -43,12 +42,13 @@ std::string cache_image(Main *bmain,
return "";
}
std::string image_name(std::to_string((uintptr_t)image));
char image_name[32];
snprintf(image_name, 32, "img_%016llx", (uint64_t)image);
image_name.append(default_format);
strcat(image_name, default_format);
BLI_path_join(
tempfile, sizeof(tempfile), BKE_tempdir_session(), "hydra_image_cache", image_name.c_str());
tempfile, sizeof(tempfile), BKE_tempdir_session(), "hydra_image_cache", image_name);
STRNCPY(opts->filepath, tempfile);
if (!BKE_image_save(reports, bmain, image, iuser, opts)) {