-
Notifications
You must be signed in to change notification settings - Fork 437
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
API won't write the environment section if config version is set to 1.0 #1903
Comments
We also faced the same issue, our workaround for now has been to simply add the environment back manually after the .ocio file is generated (which is trivial to do). I believe there was a discussion on Slack a while back about this issue but it is now long gone unfortunately. I remember mention of backward compatibility issues, @doug-walker do you remember anything? |
That is also my current workaround. I serialise to a string and then insert the environment settings before writing it to disk. |
Here is a relevant section from OpenColorIO.h:
Note that if the environment section exists, it must list all of the context vars used in the config. For v2 configs, it is essentially always in LOAD_PREDEFINED mode because serialization always includes the environment section. We felt this was important for both performance and readability of configs. We did not want to impose this on v1 configs and so the intent was to not write an empty environment section in that case. But unfortunately the code was sloppy and did not check to see if the environment had values in it, in which case it should be written. We will fix that. It was quite rare to use the environment section with v1 configs, which is probably why no one has flagged it so far. |
When serializing a config via the API, the environment section is omitted if the config's version is set to 1.0. However the environment section is supported in OpenColorIO-1.0.9 (the version currently used in our pipeline). I believe the offending line is here:
OpenColorIO/src/OpenColorIO/OCIOYaml.cpp
Line 4740 in b94a184
The text was updated successfully, but these errors were encountered: