mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-13 14:57:22 +02:00
[core] plugins: Add backbone for RezProcessEnv
The command's prefix and suffix are correctly set, but Meshroom still needs to be injected to the list of rez packages in order to be available in the `PYTHONPATH`.
This commit is contained in:
parent
dc0059132f
commit
a8d2747427
1 changed files with 25 additions and 0 deletions
|
@ -114,6 +114,31 @@ class DirTreeProcessEnv(ProcessEnv):
|
|||
return super().getCommandPrefix()
|
||||
|
||||
|
||||
class RezProcessEnv(ProcessEnv):
|
||||
"""
|
||||
"""
|
||||
def __init__(self, folder: str, envType: ProcessEnvType = ProcessEnvType.REZ, uri: str = ""):
|
||||
super().__init__(folder, envType)
|
||||
|
||||
if envType != ProcessEnvType.REZ:
|
||||
raise RuntimeError("Wrong process environment type.")
|
||||
if not uri:
|
||||
raise RuntimeError("Wrong URI for Rez environment process.")
|
||||
|
||||
def getEnvDict(self):
|
||||
env = os.environ.copy()
|
||||
|
||||
return env
|
||||
|
||||
def getCommandPrefix(self):
|
||||
if Path(self.uri).exists() and Path(self.uri).suffix == ".rxt":
|
||||
return f"rez env -i {self.uri} -c '"
|
||||
return f"rez env {self.uri} -c '"
|
||||
|
||||
def getCommandSuffix(self):
|
||||
return "'"
|
||||
|
||||
|
||||
class NodePluginStatus(Enum):
|
||||
"""
|
||||
Loading status for NodePlugin objects.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue