Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Nuke: Render Workfile Attributes #6146

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions openpype/modules/deadline/plugins/publish/submit_nuke_deadline.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin,
env_allowed_keys = []
env_search_replace_values = {}
workfile_dependency = True
use_published_workfile = True

@classmethod
def get_attribute_defs(cls):
Expand Down Expand Up @@ -85,8 +86,13 @@ def get_attribute_defs(cls):
),
BoolDef(
"workfile_dependency",
default=True,
default=cls.workfile_dependency,
label="Workfile Dependency"
),
BoolDef(
"use_published_workfile",
default=cls.use_published_workfile,
label="Use Published Workfile"
)
]

Expand Down Expand Up @@ -125,20 +131,27 @@ def process(self, instance):
render_path = instance.data['path']
script_path = context.data["currentFile"]

for item_ in context:
if "workfile" in item_.data["family"]:
template_data = item_.data.get("anatomyData")
rep = item_.data.get("representations")[0].get("name")
template_data["representation"] = rep
template_data["ext"] = rep
template_data["comment"] = None
anatomy_filled = context.data["anatomy"].format(template_data)
template_filled = anatomy_filled["publish"]["path"]
script_path = os.path.normpath(template_filled)

self.log.info(
"Using published scene for render {}".format(script_path)
)
use_published_workfile = instance.data["attributeValues"].get(
"use_published_workfile", self.use_published_workfile
)
if use_published_workfile:
for item_ in context:
tokejepsen marked this conversation as resolved.
Show resolved Hide resolved
if "workfile" in item_.data["family"]:
template_data = item_.data.get("anatomyData")
rep = item_.data.get("representations")[0].get("name")
template_data["representation"] = rep
template_data["ext"] = rep
template_data["comment"] = None
anatomy_filled = context.data["anatomy"].format(
template_data
)
template_filled = anatomy_filled["publish"]["path"]
script_path = os.path.normpath(template_filled)
self.log.info(
"Using published scene for render {}".format(
script_path
)
)

# only add main rendering job if target is not frames_farm
r_job_response_json = None
Expand Down
2 changes: 2 additions & 0 deletions openpype/settings/defaults/project_settings/deadline.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"group": "",
"department": "",
"use_gpu": true,
"workfile_dependency": true,
"use_published_workfile": true,
"env_allowed_keys": [],
"env_search_replace_values": {},
"limit_groups": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,16 @@
"key": "use_gpu",
"label": "Use GPU"
},
{
"type": "boolean",
"key": "workfile_dependency",
"label": "Workfile Dependency"
},
{
"type": "boolean",
"key": "use_published_workfile",
"label": "Use Published Workfile"
},
{
"type": "list",
"key": "env_allowed_keys",
Expand Down
4 changes: 4 additions & 0 deletions server_addon/deadline/server/settings/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class NukeSubmitDeadlineModel(BaseSettingsModel):
group: str = Field(title="Group")
department: str = Field(title="Department")
use_gpu: bool = Field(title="Use GPU")
workfile_dependency: bool = Field(title="Workfile Dependency")
use_published_workfile: bool = Field(title="Use Published Workfile")

env_allowed_keys: list[str] = Field(
default_factory=list,
Expand Down Expand Up @@ -382,6 +384,8 @@ class PublishPluginsModel(BaseSettingsModel):
"group": "",
"department": "",
"use_gpu": True,
"workfile_dependency": True,
"use_published_workfile": True,
"env_allowed_keys": [],
"env_search_replace_values": [],
"limit_groups": []
Expand Down
2 changes: 1 addition & 1 deletion server_addon/deadline/server/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.7"
__version__ = "0.2.7"
Loading