-
Notifications
You must be signed in to change notification settings - Fork 26
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
Refactored colorspace setup to be more flexible #536
Conversation
In the past, we'd set this to a hard coded value. However, that proved to be annoying to users using non-standard OCIO configs like ACES or early versions of AgX. MCprep already fixes MTL files for ACES compatibility, so we're expanding this to prep materials. In `mcprep_data.json`, there will now be a section called "non_color_options", which is a list of different options for Non-Color Data/Generic Data. If a user is using a non-standard setup, they can simply add the correct option in the JSON file and prep materials will function properly. The matching goes in order from first to last, and MCprep will use the first value matched at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change requests, but I think this largely looks good. I'll just want to live test before I fully approve (and once these little updates are made)
Running tests locally, everything passes which is good:
-------------------------------------------------------------------------------
bversion ran_tests ran skips failed errors
-------------------------------------------------------------------------------
(3.6.2) all_tests 64 2 0 No errors
(4.0.2) all_tests 64 2 0 No errors
(3.5.1) all_tests 64 2 0 No errors
(3.4.0) all_tests 64 2 0 No errors
(3.3.1) all_tests 64 2 0 No errors
(3.2.1) all_tests 64 2 0 No errors
(3.1.0) all_tests 64 2 0 No errors
(3.0.0) all_tests 64 2 0 No errors
(2.93.0) all_tests 63 3 0 No errors
(2.90.1) all_tests 63 3 0 No errors
(2.80.75) all_tests 62 4 0 No errors
@@ -69,7 +69,7 @@ class Engine(enum.Enum): | |||
class MCprepEnv: | |||
def __init__(self): | |||
self.data = None | |||
self.json_data = None | |||
self.json_data: Optional[Dict] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My POV is that if we add typing, we should do so for the entire definition (making data optional = None above as well, and also hint what the non-optional form is). Good improvement either way 👍
util.apply_colorspace(node, 'Non-Color') | ||
res = util.apply_noncolor_data(node) | ||
if res is not None: | ||
env.log(f"TypeError on {res.line} in {res.file}: {res.err_type}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we use this in several places, maybe conf.py could provide a "static" const template string? Maybe or even a utility function called log_error_lineno()
which takes this object as an input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for making this improvement!
In the past, we'd set this to a hard coded value. However, that proved to be annoying to users using non-standard OCIO configs like ACES or early versions of AgX. MCprep already fixes MTL files for ACES compatibility, so we're expanding this to prep materials.
In
mcprep_data.json
, there will now be a section called "non_color_options", which is a list of different options for Non-Color Data/Generic Data. If a user is using a non-standard setup, they can simply add the correct option in the JSON file and prep materials will function properly.The matching goes in order from first to last, and MCprep will use the first value matched at runtime.