Skip to content

Commit

Permalink
Removed use_gpu from JobInfo
Browse files Browse the repository at this point in the history
Used only for Nuke PluginInfo
  • Loading branch information
kalisp committed Nov 8, 2024
1 parent 3ebe477 commit 37dcd72
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
22 changes: 19 additions & 3 deletions client/ayon_deadline/plugins/publish/nuke/submit_nuke_deadline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pyblish.api

from ayon_core.lib import BoolDef
from ayon_core.pipeline.publish import (
AYONPyblishPluginMixin
)
Expand Down Expand Up @@ -37,6 +38,10 @@ class NukeSubmitDeadline(
families = ["render", "prerender"]
optional = True
targets = ["local"]
settings_category = "deadline"

use_gpu = None
node_class_limit_groups = {}

def process(self, instance):
"""Plugin entry point."""
Expand Down Expand Up @@ -124,8 +129,7 @@ def get_job_info(self, job_info=None, **kwargs):
start=start_frame,
end=end_frame
)

limit_groups = self._get_limit_groups(job_info.LimitGroups or [])
limit_groups = self._get_limit_groups(self.node_class_limit_groups)
job_info.LimitGroups = limit_groups

return job_info
Expand All @@ -136,19 +140,31 @@ def get_plugin_info(
context = instance.context
version = re.search(r"\d+\.\d+", context.data.get("hostVersion"))

attribute_values = self.get_attr_values_from_data(instance.data)

render_dir = os.path.dirname(render_path)
plugin_info = NukePluginInfo(
SceneFile=scene_path,
Version=version.group(),
OutputFilePath=render_dir.replace("\\", "/"),
ProjectPath=scene_path,
UseGpu=True,
UseGpu=attribute_values["use_gpu"],
WriteNode=write_node_name
)

plugin_payload: dict = asdict(plugin_info)
return plugin_payload

@classmethod
def get_attribute_defs(cls):
return [
BoolDef(
"use_gpu",
label="Use GPU",
default=cls.use_gpu,
),
]

def _get_limit_groups(self, limit_groups):
"""Search for limit group nodes and return group name.
Limit groups will be defined as pairs in Nuke deadline submitter
Expand Down
3 changes: 2 additions & 1 deletion server/settings/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class CollectJobInfoItem(BaseSettingsModel):
concurrent_tasks: int = SettingsField(
1, title="Number of concurrent tasks")
department: str = SettingsField("", title="Department")
use_gpu: bool = SettingsField("", title="Use GPU")
job_delay: str = SettingsField(
"", title="Delay job",
placeholder="dd:hh:mm:ss"
Expand Down Expand Up @@ -248,9 +247,11 @@ class NukeSubmitDeadlineModel(BaseSettingsModel):
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")

use_gpu: bool = SettingsField(True, title="Use GPU")
node_class_limit_groups: list[LimitGroupsSubmodel] = SettingsField(
default_factory=list,
title="Node based Limit Groups",
description="Provide list of node types to get particular limit"
)


Expand Down

0 comments on commit 37dcd72

Please sign in to comment.