mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
bugfix: farm rendering wasn't accepting project overrides
This commit is contained in:
parent
3256c1be9a
commit
3e87fb0dfe
1 changed files with 19 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import argparse
|
|||
import logging
|
||||
import subprocess
|
||||
import platform
|
||||
import json
|
||||
|
||||
try:
|
||||
from shutil import which
|
||||
|
|
@ -24,6 +25,18 @@ log.setLevel(logging.DEBUG)
|
|||
|
||||
error_format = "Failed {plugin.__name__}: {error} -- {error.traceback}"
|
||||
|
||||
def _load_json(path):
|
||||
assert os.path.isfile(path), ("path to json file doesn't exist")
|
||||
data = None
|
||||
with open(path, "r") as json_file:
|
||||
try:
|
||||
data = json.load(json_file)
|
||||
except Exception as exc:
|
||||
log.error(
|
||||
"Error loading json: "
|
||||
"{} - Exception: {}".format(path, exc)
|
||||
)
|
||||
return data
|
||||
|
||||
def __main__():
|
||||
parser = argparse.ArgumentParser()
|
||||
|
|
@ -77,6 +90,12 @@ def __main__():
|
|||
|
||||
paths = kwargs.paths or [os.environ.get("PYPE_METADATA_FILE")] or [os.getcwd()] # noqa
|
||||
|
||||
for path in paths:
|
||||
data = _load_json(path)
|
||||
log.info("Setting session using data from file")
|
||||
os.environ["AVALON_PROJECT"] = data["session"]["AVALON_PROJECT"]
|
||||
break
|
||||
|
||||
args = [
|
||||
os.path.join(pype_root, pype_command),
|
||||
"publish",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue