From 2fb230075de0880d72aefc5f513677cd59b5d58e Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Sat, 9 Nov 2024 16:44:09 +0100 Subject: [PATCH] Fix setting of `colorspace` --- client/ayon_blender/plugins/load/load_image_compositor.py | 6 ++++-- client/ayon_blender/plugins/load/load_image_shader.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/ayon_blender/plugins/load/load_image_compositor.py b/client/ayon_blender/plugins/load/load_image_compositor.py index ca8a5aa..78597d8 100644 --- a/client/ayon_blender/plugins/load/load_image_compositor.py +++ b/client/ayon_blender/plugins/load/load_image_compositor.py @@ -135,8 +135,10 @@ def set_source_and_colorspace( image_comp_node.frame_offset = 0 # Set colorspace if representation has colorspace data - if representation.get("colorspaceData"): - colorspace: str = representation["colorspaceData"]["colorspace"] + colorspace_data = representation.get("data", {}).get( + "colorspaceData", {}) + if colorspace_data: + colorspace: str = colorspace_data["colorspace"] if colorspace: image.colorspace_settings.name = colorspace diff --git a/client/ayon_blender/plugins/load/load_image_shader.py b/client/ayon_blender/plugins/load/load_image_shader.py index e21cd22..66c27b4 100644 --- a/client/ayon_blender/plugins/load/load_image_shader.py +++ b/client/ayon_blender/plugins/load/load_image_shader.py @@ -133,8 +133,10 @@ def set_colorspace( image = image_texture_node.image representation: dict = context["representation"] - if representation.get("colorspaceData"): - colorspace: str = representation["colorspaceData"]["colorspace"] + colorspace_data = representation.get("data", {}).get( + "colorspaceData", {}) + if colorspace_data: + colorspace: str = colorspace_data["colorspace"] if colorspace: image.colorspace_settings.name = colorspace