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

Refactor OCIO config handling, introduce fallback mechanism #834

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

Conversation

jakubjezek001
Copy link
Member

@jakubjezek001 jakubjezek001 commented Jul 31, 2024

Changelog Description

Improved color management distribution now includes fallback options. If no published OCIO config is found, the system will default to any predefined OCIO config path.

Additional info

  • Added settings conversion for transferring older version schema.
  • Added function to extract config path from profile data
  • Updated global config retrieval to use new function
  • Introduced fallback mechanism for missing product entities

Testing notes:

1.This is very difficult to test. Approach me if you can so I can help you and discuss with you the way it should work.
2. For now, just deploy to your server the settings
3. Reboot server
4. Notice that ayon+settings://core/imageio/ocio_config_profiles/0/type Published product is having additional settings for fallback.
5. Since you do not have any published product you can just type anything into the field Product name it does not matter what.
6. In fallback section set it to build in ACES1.2
7. Open Nuke or any other DCC and see that its OCIO path is pointing to the build in path. You can observer this in AYON tray console just before the DCC is opened. Look for line with >>> [ Setting OCIO environment to config path: <path>

- Added function to extract config path from profile data
- Updated global config retrieval to use new function
- Introduced fallback mechanism for missing product entities
@ynbot
Copy link
Contributor

ynbot commented Jul 31, 2024

@ynbot ynbot added type: enhancement Improvement of existing functionality or minor addition size/S labels Jul 31, 2024
… in colorspace and conversion modules.

- Update version references to 0.4.5 for future removal in colorspace module.
- Update function name and version reference to 0.4.4 for imageio config conversion in the conversion module.
@BigRoy
Copy link
Collaborator

BigRoy commented Jul 31, 2024

Could this get better testing notes - and maybe a slightly more description PR description as well. Why are these changes made and what does it now allow us to do that wasn't possible before or what does it fix?

- Removed redundant folder info handling
- Added fallback mechanism for missing folder info
jakubjezek001 and others added 4 commits August 9, 2024 13:27
Improve handling of fallback data for OCIO config path. Simplified logic and error messages for better clarity.
server/settings/main.py Outdated Show resolved Hide resolved
Adjust imageio config conversion function to handle changes in settings from 0.4.4 to 0.4.5, ensuring proper profile usage and plugin conversion consistency.
Simplified conditional check for ocio_config_profiles presence.
The commit updates the field name from "type" to "fallback_type" for consistency in the colorspace and settings modules.
Changed function name from '_conver_publish_plugins' to '_convert_publish_plugins' for consistency and clarity. Updated the function call accordingly in 'convert_settings_overrides'.
Comment on lines +17 to +39
for inx, profile in enumerate(ocio_config_profiles):
if profile["type"] != "product_name":
continue

# create new profile
new_profile = {
"type": "published_product",
"published_product": {
"product_name": profile["product_name"],
"fallback": {
"type": "builtin_path",
"builtin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio",
},
},
"host_names": profile["host_names"],
"task_names": profile["task_names"],
"task_types": profile["task_types"],
"custom_path": profile["custom_path"],
"builtin_path": profile["builtin_path"],
}

# replace old profile with new profile
ocio_config_profiles[inx] = new_profile
Copy link
Member

@iLLiCiTiT iLLiCiTiT Sep 25, 2024

Choose a reason for hiding this comment

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

Suggested change
for inx, profile in enumerate(ocio_config_profiles):
if profile["type"] != "product_name":
continue
# create new profile
new_profile = {
"type": "published_product",
"published_product": {
"product_name": profile["product_name"],
"fallback": {
"type": "builtin_path",
"builtin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio",
},
},
"host_names": profile["host_names"],
"task_names": profile["task_names"],
"task_types": profile["task_types"],
"custom_path": profile["custom_path"],
"builtin_path": profile["builtin_path"],
}
# replace old profile with new profile
ocio_config_profiles[inx] = new_profile
for profile in ocio_config_profiles:
if profile.get("type") != "product_name":
continue
profile["type"] = "published_product"
profile["published_product"] = {
"product_name": profile.pop("product_name"),
"fallback": {
"type": "builtin_path",
"builtin_path": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio",
},
}

Comment on lines +12 to +15
if "ocio_config_profiles" not in imageio_overrides:
return

ocio_config_profiles = imageio_overrides["ocio_config_profiles"]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if "ocio_config_profiles" not in imageio_overrides:
return
ocio_config_profiles = imageio_overrides["ocio_config_profiles"]
ocio_config_profiles = imageio_overrides.get("ocio_config_profiles")
if not ocio_config_profiles:
return

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S type: enhancement Improvement of existing functionality or minor addition
Projects
Status: Review In Progress
Development

Successfully merging this pull request may close these issues.

4 participants