deadline can read AYON settings

This commit is contained in:
Jakub Trllo 2024-02-09 13:00:28 +01:00
parent 163d0269e5
commit b5f7fb3162
4 changed files with 57 additions and 61 deletions

View file

@ -18,6 +18,7 @@ Attributes:
from __future__ import print_function
import os
import json
import getpass
import copy
import re
@ -131,8 +132,15 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline,
cls.group = settings.get("group", cls.group)
cls.strict_error_checking = settings.get("strict_error_checking",
cls.strict_error_checking)
cls.jobInfo = settings.get("jobInfo", cls.jobInfo)
cls.pluginInfo = settings.get("pluginInfo", cls.pluginInfo)
job_info = settings.get("jobInfo")
if job_info:
job_info = json.loads(job_info)
plugin_info = settings.get("pluginInfo")
if plugin_info:
plugin_info = json.loads(plugin_info)
cls.jobInfo = job_info or cls.jobInfo
cls.pluginInfo = plugin_info or cls.pluginInfo
def get_job_info(self):
job_info = DeadlineJobInfo(Plugin="MayaBatch")

View file

@ -40,10 +40,10 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin,
concurrent_tasks = 1
group = ""
department = ""
limit_groups = {}
limit_groups = []
use_gpu = False
env_allowed_keys = []
env_search_replace_values = {}
env_search_replace_values = []
workfile_dependency = True
use_published_workfile = True
@ -402,8 +402,10 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin,
# finally search replace in values of any key
if self.env_search_replace_values:
for key, value in environment.items():
for _k, _v in self.env_search_replace_values.items():
environment[key] = value.replace(_k, _v)
for item in self.env_search_replace_values:
environment[key] = value.replace(
item["name"], item["value"]
)
payload["JobInfo"].update({
"EnvironmentKeyValue%d" % index: "{key}={value}".format(
@ -539,8 +541,10 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin,
import nuke
captured_groups = []
for lg_name, list_node_class in self.limit_groups.items():
for node_class in list_node_class:
for limit_group in self.limit_groups:
lg_name = limit_group["name"]
for node_class in limit_group["value"]:
for node in nuke.allNodes(recurseGroups=True):
# ignore all nodes not member of defined class
if node.Class() not in node_class:

View file

@ -99,12 +99,33 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin,
"karma_rop", "vray_rop",
"redshift_rop"]
aov_filter = {"maya": [r".*([Bb]eauty).*"],
"blender": [r".*([Bb]eauty).*"],
"aftereffects": [r".*"], # for everything from AE
"harmony": [r".*"], # for everything from AE
"celaction": [r".*"],
"max": [r".*"]}
aov_filter = [
{
"name": "maya",
"value": [r".*([Bb]eauty).*"]
},
{
"name": "blender",
"value": [r".*([Bb]eauty).*"]
},
{
# for everything from AE
"name": "aftereffects",
"value": [r".*"]
},
{
"name": "harmony",
"value": [r".*"]
},
{
"name": "celaction",
"value": [r".*"]
},
{
"name": "max",
"value": [r".*"]
},
]
environ_keys = [
"FTRACK_API_USER",
@ -506,17 +527,23 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin,
self.log.debug("Instance has review explicitly disabled.")
do_not_add_review = True
aov_filter = {
item["name"]: item["value"]
for item in self.aov_filter
}
if isinstance(instance.data.get("expectedFiles")[0], dict):
instances = create_instances_for_aov(
instance, instance_skeleton_data,
self.aov_filter, self.skip_integration_repre_list,
do_not_add_review)
aov_filter,
self.skip_integration_repre_list,
do_not_add_review
)
else:
representations = prepare_representations(
instance_skeleton_data,
instance.data.get("expectedFiles"),
anatomy,
self.aov_filter,
aov_filter,
self.skip_integration_repre_list,
do_not_add_review,
instance.context,

View file

@ -951,49 +951,6 @@ def _convert_webpublisher_project_settings(ayon_settings, output):
output["webpublisher"] = ayon_webpublisher
def _convert_deadline_project_settings(ayon_settings, output):
if "deadline" not in ayon_settings:
return
ayon_deadline = ayon_settings["deadline"]
for key in ("deadline_urls",):
ayon_deadline.pop(key)
ayon_deadline_publish = ayon_deadline["publish"]
limit_groups = {
item["name"]: item["value"]
for item in ayon_deadline_publish["NukeSubmitDeadline"]["limit_groups"]
}
ayon_deadline_publish["NukeSubmitDeadline"]["limit_groups"] = limit_groups
maya_submit = ayon_deadline_publish["MayaSubmitDeadline"]
for json_key in ("jobInfo", "pluginInfo"):
src_text = maya_submit.pop(json_key)
try:
value = json.loads(src_text)
except ValueError:
value = {}
maya_submit[json_key] = value
nuke_submit = ayon_deadline_publish["NukeSubmitDeadline"]
nuke_submit["env_search_replace_values"] = {
item["name"]: item["value"]
for item in nuke_submit.pop("env_search_replace_values")
}
nuke_submit["limit_groups"] = {
item["name"]: item["value"] for item in nuke_submit.pop("limit_groups")
}
process_subsetted_job = ayon_deadline_publish["ProcessSubmittedJobOnFarm"]
process_subsetted_job["aov_filter"] = {
item["name"]: item["value"]
for item in process_subsetted_job.pop("aov_filter")
}
output["deadline"] = ayon_deadline
def _convert_royalrender_project_settings(ayon_settings, output):
if "royalrender" not in ayon_settings:
return
@ -1254,6 +1211,7 @@ def convert_project_settings(ayon_settings, default_settings):
"houdini",
"resolve",
"unreal",
"deadline",
}
for key in exact_match:
if key in ayon_settings:
@ -1276,7 +1234,6 @@ def convert_project_settings(ayon_settings, default_settings):
_convert_traypublisher_project_settings(ayon_settings, output)
_convert_webpublisher_project_settings(ayon_settings, output)
_convert_deadline_project_settings(ayon_settings, output)
_convert_royalrender_project_settings(ayon_settings, output)
_convert_kitsu_project_settings(ayon_settings, output)
_convert_shotgrid_project_settings(ayon_settings, output)