Skip to content

Commit

Permalink
Merge pull request #73 from BigRoy/bugfix/load_comp_image_colorspace
Browse files Browse the repository at this point in the history
Load Image to comp or shader: fix applying colorspace
  • Loading branch information
BigRoy authored Nov 13, 2024
2 parents 3946503 + 1bd4fe6 commit f1517f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions client/ayon_blender/plugins/load/load_image_compositor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions client/ayon_blender/plugins/load/load_image_shader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f1517f2

Please sign in to comment.