From 41983e2b3a341f9ebab012f23174f6cbcda11806 Mon Sep 17 00:00:00 2001 From: Fidifis Date: Mon, 8 Aug 2022 17:55:01 +0200 Subject: [PATCH] Preserve color space when saving Arnold textures When saving a scene with textures the change of the fileTextureName attribute causes color space to change to the default value which is sRGB. With this fix, a correct color space is preserved. --- Maya/MAYA_APP_DIR/modules/DazToMaya/scripts/d2m.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Maya/MAYA_APP_DIR/modules/DazToMaya/scripts/d2m.py b/Maya/MAYA_APP_DIR/modules/DazToMaya/scripts/d2m.py index 09a4251..663656f 100644 --- a/Maya/MAYA_APP_DIR/modules/DazToMaya/scripts/d2m.py +++ b/Maya/MAYA_APP_DIR/modules/DazToMaya/scripts/d2m.py @@ -2706,10 +2706,12 @@ def btn_save_with_text_callback(): just_file_name = os.path.basename(image_path) out_file_name = out_path + "images/" + str(just_file_name) if image_path != out_file_name: + color_space = file_node.getAttr('colorSpace') from shutil import copyfile copyfile(image_path, out_file_name) file_node.setAttr('fileTextureName', "images/" + str(just_file_name)) + file_node.setAttr('colorSpace', color_space) cmds.file(rename=save_file_result[0]) if ".ma" in save_file_result[0]: