forked from blender/blender
Fix review comments #27
@ -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)
|
||||
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user