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

Maya: Ability to set resolution for playblasts from asset, and override through review instance. #3360

Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
4 changes: 4 additions & 0 deletions openpype/hosts/maya/plugins/create/create_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class CreateReview(plugin.Creator):
keepImages = False
isolate = False
imagePlane = True
attrWidth = 0
attrHeight = 0
transparency = [
"preset",
"simple",
Expand All @@ -33,6 +35,8 @@ def __init__(self, *args, **kwargs):
for key, value in animation_data.items():
data[key] = value

data["attrWidth"] = self.attrWidth
data["attrHeight"] = self.attrHeight
data["isolate"] = self.isolate
data["keepImages"] = self.keepImages
data["imagePlane"] = self.imagePlane
Expand Down
2 changes: 2 additions & 0 deletions openpype/hosts/maya/plugins/publish/collect_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def process(self, instance):
data['handles'] = instance.data.get('handles', None)
data['step'] = instance.data['step']
data['fps'] = instance.data['fps']
data['attrWidth'] = instance.data['attrWidth']
data['attrHeight'] = instance.data['attrHeight']
data["isolate"] = instance.data["isolate"]
cmds.setAttr(str(instance) + '.active', 1)
self.log.debug('data {}'.format(instance.context[i].data))
Expand Down
32 changes: 31 additions & 1 deletion openpype/hosts/maya/plugins/publish/extract_playblast.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import glob
import contextlib

import clique
import capture

Expand Down Expand Up @@ -50,8 +51,37 @@ def process(self, instance):
['override_viewport_options']
)
preset = lib.load_capture_preset(data=self.capture_preset)

# Grab capture presets from the project settings
capture_presets = self.capture_preset
# Set resolution variables from capture presets
width_preset = capture_presets["Resolution"]["width"]
height_preset = capture_presets["Resolution"]["height"]
# Set resolution variables from asset values
asset_width = instance.data.get("resolutionWidth")
asset_height = instance.data.get("resolutionHeight")
This conversation was marked as resolved.
Show resolved Hide resolved
review_instance_width = instance.data.get("attrWidth")
review_instance_height = instance.data.get("attrHeight")
preset['camera'] = camera

# Tests if project resolution is set,
# if it is a value other than zero, that value is
# used, if not then the asset resolution is
# used

if review_instance_width != 0:
preset['width'] = review_instance_width
elif width_preset == 0:
preset['width'] = asset_width
elif width_preset != 0:
preset['width'] = width_preset

if review_instance_height != 0:
preset['height'] = review_instance_height
elif height_preset == 0:
preset['height'] = asset_height
elif height_preset != 0:
preset['height'] = height_preset
This conversation was marked as resolved.
Show resolved Hide resolved

preset['start_frame'] = start
preset['end_frame'] = end
camera_option = preset.get("camera_option", {})
Expand Down