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

Maya workfile version wasn't syncing with renders properly #711

Merged
merged 3 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 9 additions & 4 deletions pype/plugins/global/publish/submit_publish_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
deadline_pool_secondary = ""
deadline_group = ""
deadline_chunk_size = 1
deadline_priority = None

# regex for finding frame number in string
R_FRAME_NUMBER = re.compile(r'.+\.(?P<frame>[0-9]+)\..+')
Expand Down Expand Up @@ -902,7 +903,11 @@ def process(self, instance):
render_job["Props"]["User"] = context.data.get(
"deadlineUser", getpass.getuser())
# Priority is now not handled at all
render_job["Props"]["Pri"] = instance.data.get("priority")

if self.deadline_priority:
render_job["Props"]["Pri"] = self.deadline_priority
else:
render_job["Props"]["Pri"] = instance.data.get("priority")

render_job["Props"]["Env"] = {
"FTRACK_API_USER": os.environ.get("FTRACK_API_USER"),
Expand Down Expand Up @@ -1033,8 +1038,8 @@ def _get_publish_folder(self, anatomy, template_data,

anatomy_filled = anatomy.format(template_data)

if "folder" in anatomy.templates["publish"]:
publish_folder = anatomy_filled["publish"]["folder"]
if "folder" in anatomy.templates["render"]:
publish_folder = anatomy_filled["render"]["folder"]
else:
# solve deprecated situation when `folder` key is not underneath
# `publish` anatomy
Expand All @@ -1044,7 +1049,7 @@ def _get_publish_folder(self, anatomy, template_data,
" key underneath `publish` (in global of for project `{}`)."
).format(project_name))

file_path = anatomy_filled["publish"]["path"]
file_path = anatomy_filled["render"]["path"]
# Directory
publish_folder = os.path.dirname(file_path)

Expand Down
4 changes: 4 additions & 0 deletions pype/plugins/maya/publish/collect_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ def process(self, context):
if self.sync_workfile_version:
data["version"] = context.data["version"]

for instance in context:
if instance.data['family'] == "workfile":
instance.data["version"] = context.data["version"]

# Apply each user defined attribute as data
for attr in cmds.listAttr(layer, userDefined=True) or list():
try:
Expand Down
2 changes: 1 addition & 1 deletion pype/plugins/photoshop/load/load_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ImageLoader(api.Loader):
Stores the imported asset in a container named after the asset.
"""

families = ["image"]
families = ["image", "render"]
representations = ["*"]

def load(self, context, name=None, namespace=None, data=None):
Expand Down