[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:
Candice Bentéjac 2025-06-10 17:18:33 +02:00
parent dc0059132f
commit a8d2747427

View file

@ -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.