Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 39 additions & 11 deletions client/ayon_nuke/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,18 +947,24 @@ def get_representation_data(
range=False,
custom_tags=None,
colorspace=None,
display=None,
view=None,
):
"""Add representation data to self.data
"""Add representation data to self.data.

Args:
tags (list[str], optional): list of defined tags.
Defaults to None.
Defaults to None.
range (bool, optional): flag for adding ranges.
Defaults to False.
Defaults to False.
custom_tags (list[str], optional): user inputted custom tags.
Defaults to None.
Defaults to None.
colorspace (str, optional): colorspace name.
Defaults to None.
Defaults to None.
display (str, optional): display name.
Defaults to None.
view (str, optional): view name.
Defaults to None.
"""
add_tags = tags or []
repre = {
Expand Down Expand Up @@ -1001,6 +1007,20 @@ def get_representation_data(
colorspace=colorspace,
log=self.log
)
elif display and view:
set_colorspace_data_to_representation(
repre,
self.instance.context.data,
colorspace=display,
log=self.log
)
# remove colorspace key from colorspaceData
repre["colorspaceData"].pop("colorspace", None)
repre["colorspaceData"].update({
"display": display,
"view": view,
})
Comment on lines +1018 to +1022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be more explicit to adjust the colorspace data from the instance.data to collect display and view instead of doing in representation data?

@BigRoy BigRoy Aug 5, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most accurate would be if we always store it in representation display view I think, if we can. Because that way different representations can each have a different colorspace or display/view set instead of all representations sharing the one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakubjezek001 can you make a follow up issue to core to allows also setting display and view via set_colorspace_data_to_representation?


self.data["representations"].append(repre)

def get_imageio_baking_profile(self):
Expand Down Expand Up @@ -1256,6 +1276,8 @@ def save_file(self):
def generate_mov(self, farm=False, delete=True, **kwargs):
# colorspace data
colorspace = self.write_colorspace
display = None
view = None

# get colorspace settings
# get colorspace data from context
Expand Down Expand Up @@ -1351,12 +1373,7 @@ def generate_mov(self, farm=False, delete=True, **kwargs):

node["view"].setValue(view)

if config_data:
# convert display and view to colorspace
colorspace = get_display_view_colorspace_name(
config_path=config_data["path"],
display=display, view=view
)
colorspace = None

# OCIOColorSpace
elif baking_colorspace["type"] == "colorspace":
Expand Down Expand Up @@ -1456,11 +1473,22 @@ def generate_mov(self, farm=False, delete=True, **kwargs):
if delete:
tags.append("delete")

if config_data and (not colorspace and not display):
# backward compatibility: convert display and view to colorspace
# just in case older nuke_default ocio config
colorspace = get_display_view_colorspace_name(
config_path=config_data["path"],
display=display,
view=view
)
Comment thread
jakubjezek001 marked this conversation as resolved.

self.get_representation_data(
tags=tags + add_tags,
custom_tags=add_custom_tags,
range=True,
colorspace=colorspace,
display=display,
view=view,
)

self.log.debug(f"Representation... `{self.data}`")
Expand Down
Loading