hiero: solve custom ocio path

This commit is contained in:
Jakub Jezek 2021-12-07 15:57:44 +01:00
parent ad81890d6b
commit 0270b136cc
No known key found for this signature in database
GPG key ID: D8548FBF690B100A

View file

@ -4,6 +4,7 @@ Host specific functions where host api is connected
import os
import re
import sys
import platform
import ast
import shutil
import hiero
@ -783,6 +784,13 @@ def _set_hrox_project_knobs(doc, **knobs):
# set attributes to Project Tag
proj_elem = doc.documentElement().firstChildElement("Project")
for k, v in knobs.items():
if "ocioconfigpath" in k:
paths_to_format = v[platform.system().lower()]
for _path in paths_to_format:
v = _path.format(**os.environ)
if not os.path.exists(v):
continue
log.debug("Project colorspace knob `{}` was set to `{}`".format(k, v))
if isinstance(v, dict):
continue
proj_elem.setAttribute(str(k), v)