mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Improvement
Cleaner way to resolve <MAYA_RESOURCES> in path.
This commit is contained in:
parent
3279634dac
commit
7a7f87e861
2 changed files with 4 additions and 13 deletions
|
|
@ -3474,13 +3474,10 @@ def get_color_management_preferences():
|
|||
query=True, configFilePath=True
|
||||
)
|
||||
|
||||
# Resolve environment variables in config path. "MAYA_RESOURCES" are in the
|
||||
# path by default.
|
||||
def _subst_with_env_value(match):
|
||||
key = match.group(1)
|
||||
return os.environ.get(key, "")
|
||||
|
||||
path = re.sub(r'<([^>]+)>', _subst_with_env_value, path)
|
||||
# The OCIO config supports a custom <MAYA_RESOURCES> token.
|
||||
maya_resources_token = "<MAYA_RESOURCES>"
|
||||
maya_resources_path = om.MGlobal.getAbsolutePathToResources()
|
||||
path = path.replace(maya_resources_token, maya_resources_path)
|
||||
|
||||
data["config"] = path
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,6 @@ from openpype.pipeline import install_host
|
|||
from openpype.hosts.maya.api import MayaHost
|
||||
from maya import cmds
|
||||
|
||||
# MAYA_RESOURCES enviornment variable is referenced in default OCIO path but
|
||||
# it's not part of the environment. Patching this so it works as expected.
|
||||
if "MAYA_RESOURCES" not in os.environ:
|
||||
os.environ["MAYA_RESOURCES"] = os.path.join(
|
||||
os.environ["MAYA_LOCATION"], "resources"
|
||||
).replace("\\", "/")
|
||||
|
||||
host = MayaHost()
|
||||
install_host(host)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue