General: Environment variable for default OCIO configs (#4670)

* set 'BUILTIN_OCIO_ROOT' environment variable in start.py

We need to use simplified variant to fill default ocio root for OCIO configs to replace '{OPENPYPE_ROOT}/vendor/bin/ocioconfig/OpenColorIOConfigs' in settings.

The explicit path from OPENPYPE_ROOT disable option to change the path elsewhere without harm of settings change. Using 'BUILTIN_OCIO_ROOT' can be usd universally.

* use new env variable in OCIO settings
This commit is contained in:
Jakub Trllo 2023-03-21 16:49:45 +01:00 committed by Jakub Trllo
parent f58994d59c
commit 33148f45e7
2 changed files with 11 additions and 2 deletions

View file

@ -3,8 +3,8 @@
"activate_global_color_management": false,
"ocio_config": {
"filepath": [
"{OPENPYPE_ROOT}/vendor/bin/ocioconfig/OpenColorIOConfigs/aces_1.2/config.ocio",
"{OPENPYPE_ROOT}/vendor/bin/ocioconfig/OpenColorIOConfigs/nuke-default/config.ocio"
"{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio",
"{BUILTIN_OCIO_ROOT}/nuke-default/config.ocio"
]
},
"file_rules": {

View file

@ -197,6 +197,15 @@ if "--headless" in sys.argv:
elif os.getenv("OPENPYPE_HEADLESS_MODE") != "1":
os.environ.pop("OPENPYPE_HEADLESS_MODE", None)
# Set builtin ocio root
os.environ["BUILTIN_OCIO_ROOT"] = os.path.join(
OPENPYPE_ROOT,
"vendor",
"bin",
"ocioconfig",
"OpenColorIOConfigs"
)
# Enabled logging debug mode when "--debug" is passed
if "--verbose" in sys.argv:
expected_values = (