Skip to content

Commit

Permalink
Apply settings to Ayon Houdini submitters
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Feb 8, 2024
1 parent c50e07c commit 24804e6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,19 @@ class HoudiniCacheSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline
targets = ["local"]

priority = 50
ChunkSize = 999999
group = None
jobInfo = {}
pluginInfo = {}
group = None

@classmethod
def apply_settings(cls, project_settings, system_settings):
settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitCacheDeadline"] # noqa
cls.priority = settings.get("priority", cls.priority)
cls.ChunkSize = settings.get("chunk_size", cls.ChunkSize)
cls.group = settings.get("group", cls.group)

def get_job_info(self):
job_info = DeadlineJobInfo(Plugin="Houdini")

Expand Down Expand Up @@ -89,7 +98,7 @@ def get_job_info(self):

attr_values = self.get_attr_values_from_data(instance.data)

job_info.ChunkSize = instance.data["chunkSize"]
job_info.ChunkSize = instance.data.get("chunkSize", self.ChunkSize)
job_info.Comment = context.data.get("comment")
job_info.Priority = attr_values.get("priority", self.priority)
job_info.Group = attr_values.get("group", self.group)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from openpype_modules.deadline.abstract_submit_deadline import DeadlineJobInfo
from ayon_core.lib import (
BoolDef,
TextDef,
NumberDef
)

Expand Down Expand Up @@ -76,16 +77,33 @@ class HoudiniSubmitDeadline(
use_published = True

# presets
priority = 50
chunk_size = 1
export_priority = 50
export_chunk_size = 10
group = ""
export_group = ""
priority = 50
chunk_size = 1
group = ""

@classmethod
def apply_settings(cls, project_settings, system_settings):
export_settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitExportDeadline"] # noqa
cls.export_priority = export_settings.get("priority", cls.export_priority)
cls.export_chunk_size = export_settings.get("chunk_size", cls.export_chunk_size)
cls.export_group = export_settings.get("group", cls.export_group)

render_settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitRenderDeadline"] # noqa
cls.priority = render_settings.get("priority", cls.priority)
cls.chunk_size = render_settings.get("chunk_size", cls.chunk_size)
cls.group = render_settings.get("group", cls.group)

@classmethod
def get_attribute_defs(cls):
return [
BoolDef(
"suspend_publish",
default=False,
label="Suspend publish"
),
NumberDef(
"priority",
label="Priority",
Expand All @@ -100,10 +118,14 @@ def get_attribute_defs(cls):
minimum=1,
maximum=1000
),
TextDef("group",
default=cls.group,
label="Group Name"
),
NumberDef(
"export_priority",
label="Export Priority",
default=cls.priority,
default=cls.export_priority,
decimals=0
),
NumberDef(
Expand All @@ -114,11 +136,9 @@ def get_attribute_defs(cls):
minimum=1,
maximum=1000
),
BoolDef(
"suspend_publish",
default=False,
label="Suspend publish"
)
TextDef("export_group",
default=cls.export_group,
label="Export Group Name"),
]

def get_job_info(self, dependency_job_ids=None):
Expand Down Expand Up @@ -158,15 +178,6 @@ def get_job_info(self, dependency_job_ids=None):
job_info.UserName = context.data.get(
"deadlineUser", getpass.getuser())

if split_render_job and is_export_job:
job_info.Priority = attribute_values.get(
"export_priority", self.export_priority
)
else:
job_info.Priority = attribute_values.get(
"priority", self.priority
)

if is_in_tests():
job_info.BatchName += datetime.now().strftime("%d%m%Y%H%M%S")

Expand All @@ -187,15 +198,23 @@ def get_job_info(self, dependency_job_ids=None):

job_info.Pool = instance.data.get("primaryPool")
job_info.SecondaryPool = instance.data.get("secondaryPool")
job_info.Group = self.group

if split_render_job and is_export_job:
job_info.Priority = attribute_values.get(
"export_priority", self.export_priority
)
job_info.ChunkSize = attribute_values.get(
"export_chunk", self.export_chunk_size
)
job_info.Group = self.export_group
else:
job_info.Priority = attribute_values.get(
"priority", self.priority
)
job_info.ChunkSize = attribute_values.get(
"chunk", self.chunk_size
)
job_info.Group = self.group

job_info.Comment = context.data.get("comment")

Expand Down

0 comments on commit 24804e6

Please sign in to comment.