mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
context set by env vars, configurable review for collected jobs
This commit is contained in:
parent
aadf253a13
commit
41d4358500
5 changed files with 62 additions and 2 deletions
|
|
@ -77,6 +77,7 @@ class CollectSequencesFromJob(pyblish.api.ContextPlugin):
|
||||||
order = pyblish.api.CollectorOrder
|
order = pyblish.api.CollectorOrder
|
||||||
targets = ["rr_control"]
|
targets = ["rr_control"]
|
||||||
label = "Collect Rendered Frames"
|
label = "Collect Rendered Frames"
|
||||||
|
review = True
|
||||||
|
|
||||||
def process(self, context):
|
def process(self, context):
|
||||||
if os.environ.get("OPENPYPE_PUBLISH_DATA"):
|
if os.environ.get("OPENPYPE_PUBLISH_DATA"):
|
||||||
|
|
@ -150,7 +151,7 @@ class CollectSequencesFromJob(pyblish.api.ContextPlugin):
|
||||||
families.append("render")
|
families.append("render")
|
||||||
if "ftrack" not in families:
|
if "ftrack" not in families:
|
||||||
families.append("ftrack")
|
families.append("ftrack")
|
||||||
if "review" not in families:
|
if "review" not in families and self.review:
|
||||||
families.append("review")
|
families.append("review")
|
||||||
|
|
||||||
for collection in collections:
|
for collection in collections:
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ class OpenPypeContextSelector:
|
||||||
|
|
||||||
def run_publish(self):
|
def run_publish(self):
|
||||||
"""Run publish process."""
|
"""Run publish process."""
|
||||||
env = {'AVALON_PROJECT': str(self.context.get("project")),
|
env = {"AVALON_PROJECT": str(self.context.get("project")),
|
||||||
"AVALON_ASSET": str(self.context.get("asset")),
|
"AVALON_ASSET": str(self.context.get("asset")),
|
||||||
"AVALON_TASK": str(self.context.get("task")),
|
"AVALON_TASK": str(self.context.get("task")),
|
||||||
"AVALON_APP_NAME": str(self.context.get("app_name"))}
|
"AVALON_APP_NAME": str(self.context.get("app_name"))}
|
||||||
|
|
@ -179,4 +179,18 @@ class OpenPypeContextSelector:
|
||||||
|
|
||||||
print("running selector")
|
print("running selector")
|
||||||
selector = OpenPypeContextSelector()
|
selector = OpenPypeContextSelector()
|
||||||
|
|
||||||
|
# try to set context from environment
|
||||||
|
selector.context["project"] = os.getenv("AVALON_PROJECT")
|
||||||
|
selector.context["asset"] = os.getenv("AVALON_ASSET")
|
||||||
|
selector.context["task"] = os.getenv("AVALON_TASK")
|
||||||
|
selector.context["app_name"] = os.getenv("AVALON_APP_NAME")
|
||||||
|
|
||||||
|
# if anything inside is None, scratch the whole thing and
|
||||||
|
# ask user for context.
|
||||||
|
for _, v in selector.context.items():
|
||||||
|
if not v:
|
||||||
|
selector.context = {}
|
||||||
|
break
|
||||||
|
|
||||||
selector.process_job()
|
selector.process_job()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"publish": {
|
||||||
|
"CollectSequencesFromJob": {
|
||||||
|
"review": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -66,6 +66,10 @@
|
||||||
"type": "schema",
|
"type": "schema",
|
||||||
"name": "schema_project_deadline"
|
"name": "schema_project_deadline"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "schema",
|
||||||
|
"name": "schema_project_royalrender"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "schema",
|
"type": "schema",
|
||||||
"name": "schema_project_slack"
|
"name": "schema_project_slack"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"type": "dict",
|
||||||
|
"key": "royalrender",
|
||||||
|
"label": "Royal Render",
|
||||||
|
"collapsible": true,
|
||||||
|
"is_file": true,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "dict",
|
||||||
|
"collapsible": true,
|
||||||
|
"key": "publish",
|
||||||
|
"label": "Publish plugins",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "label",
|
||||||
|
"label": "Collectors"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "dict",
|
||||||
|
"collapsible": true,
|
||||||
|
"key": "CollectSequencesFromJob",
|
||||||
|
"label": "Collect Sequences from the Job",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"key": "review",
|
||||||
|
"label": "Generate reviews from sequences"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue