mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
OP-3277 - added functionality to replace root value with environment variable.
Useful for remote workflows where Site Sync is being used.
When Load reference is used, real root value (c:/project) is replaced with ${OPENPYPE_ROOT_WORK}.
This commit is contained in:
parent
303eabd0a2
commit
d404fbf8a2
1 changed files with 4 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ from openpype.pipeline import (
|
|||
legacy_create,
|
||||
)
|
||||
import openpype.hosts.maya.api.plugin
|
||||
from openpype.api import Anatomy
|
||||
from openpype.hosts.maya.api.lib import maintained_selection
|
||||
|
||||
|
||||
|
|
@ -51,7 +52,9 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
|
|||
|
||||
with maintained_selection():
|
||||
cmds.loadPlugin("AbcImport.mll", quiet=True)
|
||||
nodes = cmds.file(self.fname,
|
||||
anatomy = Anatomy(context["project"]["code"])
|
||||
file_url = anatomy.replace_root_with_env_key(self.fname, '${{{}}}')
|
||||
nodes = cmds.file(file_url,
|
||||
namespace=namespace,
|
||||
sharedReferenceFile=False,
|
||||
reference=True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue