mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
use 'AYON_PROJECT_ROOT_' prefix for project roots
This commit is contained in:
parent
e8954219ae
commit
634d2daf60
3 changed files with 11 additions and 15 deletions
|
|
@ -925,8 +925,8 @@ class ReferenceLoader(Loader):
|
|||
def prepare_root_value(self, file_url, project_name):
|
||||
"""Replace root value with env var placeholder.
|
||||
|
||||
Use ${OPENPYPE_ROOT_WORK} (or any other root) instead of proper root
|
||||
value when storing referenced url into a workfile.
|
||||
Use ${AYON_PROJECT_ROOT_WORK} (or any other root) instead of proper
|
||||
root value when storing referenced url into a workfile.
|
||||
Useful for remote workflows with SiteSync.
|
||||
|
||||
Args:
|
||||
|
|
|
|||
|
|
@ -2227,7 +2227,7 @@ Reopening Nuke should synchronize these paths and resolve any discrepancies.
|
|||
|
||||
# include all project root related env vars
|
||||
for env_var in os.environ:
|
||||
if env_var.startswith("OPENPYPE_PROJECT_ROOT_"):
|
||||
if env_var.startswith("AYON_PROJECT_ROOT_"):
|
||||
included_vars.append(env_var)
|
||||
|
||||
# use regex to find env var in template with format {ENV_VAR}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class BaseAnatomy(object):
|
|||
return self._roots_obj
|
||||
|
||||
def root_environments(self):
|
||||
"""Return OPENPYPE_ROOT_* environments for current project in dict."""
|
||||
"""Return AYON_PROJECT_ROOT_* environments for current project."""
|
||||
return self._roots_obj.root_environments()
|
||||
|
||||
def root_environmets_fill_data(self, template=None):
|
||||
|
|
@ -150,7 +150,7 @@ class BaseAnatomy(object):
|
|||
return self.roots_obj.all_root_paths()
|
||||
|
||||
def set_root_environments(self):
|
||||
"""Set OPENPYPE_ROOT_* environments for current project."""
|
||||
"""Set AYON_PROJECT_ROOT_* environments for current project."""
|
||||
self._roots_obj.set_root_environments()
|
||||
|
||||
def root_names(self):
|
||||
|
|
@ -289,7 +289,7 @@ class BaseAnatomy(object):
|
|||
"<{}>"
|
||||
|
||||
## Output
|
||||
"<OPENPYPE_PROJECT_ROOT_NAS>/project/asset/task/animation_v001.ma"
|
||||
"<AYON_PROJECT_ROOT_NAS>/project/asset/task/animation_v001.ma"
|
||||
|
||||
Args:
|
||||
filepath (str): Full file path where root should be replaced.
|
||||
|
|
@ -1206,7 +1206,7 @@ class Roots:
|
|||
anatomy Anatomy: Anatomy object created for a specific project.
|
||||
"""
|
||||
|
||||
env_prefix = "OPENPYPE_PROJECT_ROOT"
|
||||
env_prefix = "AYON_PROJECT_ROOT"
|
||||
roots_filename = "roots.json"
|
||||
|
||||
def __init__(self, anatomy):
|
||||
|
|
@ -1312,8 +1312,8 @@ class Roots:
|
|||
def root_environments(self):
|
||||
"""Use root keys to create unique keys for environment variables.
|
||||
|
||||
Concatenates prefix "OPENPYPE_ROOT" with root keys to create unique
|
||||
keys.
|
||||
Concatenates prefix "AYON_PROJECT_ROOT_" with root keys to create
|
||||
unique keys.
|
||||
|
||||
Returns:
|
||||
dict: Result is `{(str): (str)}` dicitonary where key represents
|
||||
|
|
@ -1335,14 +1335,10 @@ class Roots:
|
|||
|
||||
Result on windows platform::
|
||||
{
|
||||
"OPENPYPE_ROOT_WORK": "P:/projects/work",
|
||||
"OPENPYPE_ROOT_PUBLISH": "P:/projects/publish"
|
||||
"AYON_PROJECT_ROOT_WORK": "P:/projects/work",
|
||||
"AYON_PROJECT_ROOT_PUBLISH": "P:/projects/publish"
|
||||
}
|
||||
|
||||
Short example when multiroot is not used::
|
||||
{
|
||||
"OPENPYPE_ROOT": "P:/projects"
|
||||
}
|
||||
"""
|
||||
return self._root_environments()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue