mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
use 'AYON_PUBLISH_DATA' over 'OPENPYPE_PUBLISH_DATA'
This commit is contained in:
parent
90daf1ee95
commit
b506a9fb2c
6 changed files with 28 additions and 14 deletions
|
|
@ -108,7 +108,7 @@ class Commands:
|
|||
else:
|
||||
pyblish.api.register_target("farm")
|
||||
|
||||
os.environ["OPENPYPE_PUBLISH_DATA"] = os.pathsep.join(paths)
|
||||
os.environ["AYON_PUBLISH_DATA"] = os.pathsep.join(paths)
|
||||
os.environ["HEADLESS_PUBLISH"] = 'true' # to use in app lib
|
||||
|
||||
log.info("Running publish ...")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from ayon_core.tests.lib import is_in_tests
|
|||
|
||||
|
||||
class CollectBatchData(pyblish.api.ContextPlugin):
|
||||
"""Collect batch data from json stored in 'OPENPYPE_PUBLISH_DATA' env dir.
|
||||
"""Collect batch data from json stored in 'AYON_PUBLISH_DATA' env dir.
|
||||
|
||||
The directory must contain 'manifest.json' file where batch data should be
|
||||
stored.
|
||||
|
|
@ -39,13 +39,16 @@ class CollectBatchData(pyblish.api.ContextPlugin):
|
|||
|
||||
def process(self, context):
|
||||
self.log.info("CollectBatchData")
|
||||
batch_dir = os.environ.get("OPENPYPE_PUBLISH_DATA")
|
||||
batch_dir = (
|
||||
os.environ.get("AYON_PUBLISH_DATA")
|
||||
or os.environ.get("OPENPYPE_PUBLISH_DATA")
|
||||
)
|
||||
if is_in_tests():
|
||||
self.log.debug("Automatic testing, no batch data, skipping")
|
||||
return
|
||||
|
||||
assert batch_dir, (
|
||||
"Missing `OPENPYPE_PUBLISH_DATA`")
|
||||
"Missing `AYON_PUBLISH_DATA`")
|
||||
|
||||
assert os.path.exists(batch_dir), \
|
||||
"Folder {} doesn't exist".format(batch_dir)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,10 @@ class CollectColorCodedInstances(pyblish.api.ContextPlugin):
|
|||
|
||||
def process(self, context):
|
||||
self.log.info("CollectColorCodedInstances")
|
||||
batch_dir = os.environ.get("OPENPYPE_PUBLISH_DATA")
|
||||
batch_dir = (
|
||||
os.environ.get("AYON_PUBLISH_DATA")
|
||||
or os.environ.get("OPENPYPE_PUBLISH_DATA")
|
||||
)
|
||||
if (is_in_tests() and
|
||||
(not batch_dir or not os.path.exists(batch_dir))):
|
||||
self.log.debug("Automatic testing, no batch data, skipping")
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ def collect(root,
|
|||
class CollectSequencesFromJob(pyblish.api.ContextPlugin):
|
||||
"""Gather file sequences from job directory.
|
||||
|
||||
When "OPENPYPE_PUBLISH_DATA" environment variable is set these paths
|
||||
When "AYON_PUBLISH_DATA" environment variable is set these paths
|
||||
(folders or .json files) are parsed for image sequences. Otherwise, the
|
||||
current working directory is searched for file sequences.
|
||||
|
||||
|
|
@ -91,9 +91,13 @@ class CollectSequencesFromJob(pyblish.api.ContextPlugin):
|
|||
["review"]
|
||||
)
|
||||
|
||||
if os.environ.get("OPENPYPE_PUBLISH_DATA"):
|
||||
self.log.debug(os.environ.get("OPENPYPE_PUBLISH_DATA"))
|
||||
paths = os.environ["OPENPYPE_PUBLISH_DATA"].split(os.pathsep)
|
||||
publish_data_paths = (
|
||||
os.environ.get("AYON_PUBLISH_DATA")
|
||||
or os.environ.get("OPENPYPE_PUBLISH_DATA")
|
||||
)
|
||||
if publish_data_paths:
|
||||
self.log.debug(publish_data_paths)
|
||||
paths = publish_data_paths.split(os.pathsep)
|
||||
self.log.info("Collecting paths: {}".format(paths))
|
||||
else:
|
||||
cwd = context.get("workspaceDir", os.getcwd())
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ def install_host(host):
|
|||
MessageHandler.emit = modified_emit
|
||||
|
||||
if os.environ.get("AYON_REMOTE_PUBLISH"):
|
||||
# target "farm" == rendering on farm, expects OPENPYPE_PUBLISH_DATA
|
||||
# target "farm" == rendering on farm, expects AYON_PUBLISH_DATA
|
||||
# target "remote" == remote execution, installs host
|
||||
print("Registering pyblish target: remote")
|
||||
pyblish.api.register_target("remote")
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from ayon_core.pipeline.publish.lib import add_repre_files_for_cleanup
|
|||
class CollectRenderedFiles(pyblish.api.ContextPlugin):
|
||||
"""
|
||||
This collector will try to find json files in provided
|
||||
`OPENPYPE_PUBLISH_DATA`. Those files _MUST_ share same context.
|
||||
`AYON_PUBLISH_DATA`. Those files _MUST_ share same context.
|
||||
|
||||
Note:
|
||||
We should split this collector and move the part which handle reading
|
||||
|
|
@ -140,13 +140,17 @@ class CollectRenderedFiles(pyblish.api.ContextPlugin):
|
|||
def process(self, context):
|
||||
self._context = context
|
||||
|
||||
if not os.environ.get("OPENPYPE_PUBLISH_DATA"):
|
||||
raise KnownPublishError("Missing `OPENPYPE_PUBLISH_DATA`")
|
||||
publish_data_paths = (
|
||||
os.environ.get("AYON_PUBLISH_DATA")
|
||||
or os.environ.get("OPENPYPE_PUBLISH_DATA")
|
||||
)
|
||||
if publish_data_paths:
|
||||
raise KnownPublishError("Missing `AYON_PUBLISH_DATA`")
|
||||
|
||||
# QUESTION
|
||||
# Do we support (or want support) multiple files in the variable?
|
||||
# - what if they have different context?
|
||||
paths = os.environ["OPENPYPE_PUBLISH_DATA"].split(os.pathsep)
|
||||
paths = publish_data_paths.split(os.pathsep)
|
||||
|
||||
# Using already collected Anatomy
|
||||
anatomy = context.data["anatomy"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue