This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into bugfix/extract_oiio_transcode
- Loading branch information
Showing
6 changed files
with
67 additions
and
93 deletions.
There are no files selected for viewing
77 changes: 0 additions & 77 deletions
77
openpype/hosts/maya/plugins/publish/validate_look_members_unique.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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): | ||
|
@@ -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" | ||
) | ||
] | ||
|
||
|
@@ -125,20 +131,11 @@ 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( | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tokejepsen
Author
Member
|
||
"use_published_workfile", self.use_published_workfile | ||
) | ||
if use_published_workfile: | ||
script_path = self._get_published_workfile_path(context) | ||
|
||
# only add main rendering job if target is not frames_farm | ||
r_job_response_json = None | ||
|
@@ -197,6 +194,44 @@ def process(self, instance): | |
families.insert(0, "prerender") | ||
instance.data["families"] = families | ||
|
||
def _get_published_workfile_path(self, context): | ||
"""This method is temporary while the class is not inherited from | ||
AbstractSubmitDeadline""" | ||
for instance in context: | ||
if ( | ||
instance.data["family"] != "workfile" | ||
# Disabled instances won't be integrated | ||
or instance.data("publish") is False | ||
): | ||
continue | ||
template_data = instance.data["anatomyData"] | ||
# Expect workfile instance has only one representation | ||
representation = instance.data["representations"][0] | ||
# Get workfile extension | ||
repre_file = representation["files"] | ||
self.log.info(repre_file) | ||
ext = os.path.splitext(repre_file)[1].lstrip(".") | ||
|
||
# Fill template data | ||
template_data["representation"] = representation["name"] | ||
template_data["ext"] = ext | ||
template_data["comment"] = None | ||
|
||
anatomy = context.data["anatomy"] | ||
# WARNING Hardcoded template name 'publish' > may not be used | ||
template_obj = anatomy.templates_obj["publish"]["path"] | ||
|
||
template_filled = template_obj.format(template_data) | ||
script_path = os.path.normpath(template_filled) | ||
self.log.info( | ||
"Using published scene for render {}".format( | ||
script_path | ||
) | ||
) | ||
return script_path | ||
|
||
return None | ||
|
||
def payload_submit( | ||
self, | ||
instance, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.1.7" | ||
__version__ = "0.1.8" |
Out of curiosity - should we also remove the fact that these values get stored into
attributeValues
. The original data for the instance attribute is already stored in theinstance.data
.Storing it also to
attributeValues
makes it feel like you're doing something else with that data - which you aren't - or makes it feel like you might be accessing it on other plugins which I think you're also not doing.How about just:
And if you need it again in
payload_submit
either use that method again OR just pass it along as an argument explicitly?