Skip to content

Colorspace now allows empty file representation list #1210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jrsndl
Copy link
Contributor

@jrsndl jrsndl commented Mar 24, 2025

Changelog Description

Colorspace.py now check for empty file representation list.

Testing notes:

  1. In Nuke, make sure render work folder (staging dir) has no rendered frames
  2. Try to publish on farm with existing frames
  3. Publisher should stop on rendered frames validatior, not on colorspace error

Can fix #97
Might also fix #66

@ynbot ynbot added type: bug Something isn't working size/XS labels Mar 24, 2025
filename = representation["files"]
if isinstance(filename, list):
filename = filename[0]
filename = representation["files"][0] if representation["files"] else None
Copy link
Collaborator

Choose a reason for hiding this comment

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

This logic is wrong unfortunately. files may be a single filename str... so we'd still need the list check at least.

Suggested change
filename = representation["files"][0] if representation["files"] else None
filename = representation["files"]
if isinstance(filename, list):
if filename:
filename = filename[0]
else:
filename = None

However, I really don't think this is the best fix here. We're suddenly allowing this to continue in a way where it may not be sensible to actually continue. I think this erroring is correct and hence we should handle the error elsewhere instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intention is just to pass the error to validator that is working properly, with message that artist can understand.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The intention is good I think - but I think it makes more sense for collect_writes.py to NOT set representation colorspace IF there are no files if apparently, it cannot? Or at least capture it accordingly instead of silently ignoring it here where it we're expecting it to just work... instead of ignore silently?

Comment on lines 1279 to +1283
if isinstance(filename, list):
filename = filename[0]
if filename:
filename = filename[0]
else:
filename = None
Copy link
Member

Choose a reason for hiding this comment

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

The filename is needed only if colorspace is None so we should move it under the condition. And we should not set it to None as that would cause crash in get_imageio_file_rules_colorspace_from_filepath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS type: bug Something isn't working
Projects
None yet
4 participants