Skip to content
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

Merged
merged 4 commits into from
Jan 31, 2024

Conversation

StandingPadAnimations
Copy link
Collaborator

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.

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.
@StandingPadAnimations StandingPadAnimations added this to the v3.6.0 milestone Jan 20, 2024
@StandingPadAnimations StandingPadAnimations requested a review from a team January 20, 2024 20:14
Copy link
Member

@TheDuckCow TheDuckCow left a 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
Copy link
Member

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 👍

MCprep_addon/conf.py Outdated Show resolved Hide resolved
MCprep_addon/conf.py Outdated Show resolved Hide resolved
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}")
Copy link
Member

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.

MCprep_addon/util.py Outdated Show resolved Hide resolved
Copy link
Member

@TheDuckCow TheDuckCow left a 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!

@StandingPadAnimations StandingPadAnimations merged commit fc917e6 into milestone-3-6-0 Jan 31, 2024
@StandingPadAnimations StandingPadAnimations deleted the non-color-fixes branch January 31, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants