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

Maya capture 'isolate_view' fix + minor corrections #1617

Merged
merged 6 commits into from
Jun 2, 2021
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
18 changes: 2 additions & 16 deletions openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,7 @@ def _get_attrs(node):
return world_space_nodes


def load_capture_preset(path=None, data=None):
def load_capture_preset(data=None):
import capture

preset = data
Expand All @@ -2139,11 +2139,7 @@ def load_capture_preset(path=None, data=None):
# GENERIC
id = 'Generic'
for key in preset[id]:
if key.startswith('isolate'):
pass
# options['isolate'] = preset[id][key]
else:
options[str(key)] = preset[id][key]
options[str(key)] = preset[id][key]

# RESOLUTION
id = 'Resolution'
Expand Down Expand Up @@ -2220,16 +2216,6 @@ def load_capture_preset(path=None, data=None):
# use active sound track
scene = capture.parse_active_scene()
options['sound'] = scene['sound']
cam_options = dict()
cam_options['overscan'] = 1.0
cam_options['displayFieldChart'] = False
cam_options['displayFilmGate'] = False
cam_options['displayFilmOrigin'] = False
cam_options['displayFilmPivot'] = False
cam_options['displayGateMask'] = False
cam_options['displayResolution'] = False
cam_options['displaySafeAction'] = False
cam_options['displaySafeTitle'] = False

# options['display_options'] = temp_options

Expand Down
5 changes: 1 addition & 4 deletions openpype/hosts/maya/plugins/publish/extract_playblast.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def process(self, instance):

# Isolate view is requested by having objects in the set besides a
# camera.
if instance.data.get("isolate"):
if preset.pop("isolate_view", False) or instance.data.get("isolate"):
preset["isolate"] = instance.data["setMembers"]

# Show/Hide image planes on request.
Expand All @@ -93,9 +93,6 @@ def process(self, instance):
# playblast and viewer
preset['viewer'] = False

# Remove panel key since it's internal value to capture_gui
preset.pop("panel", None)

self.log.info('using viewport preset: {}'.format(preset))

path = capture.capture(**preset)
Expand Down
16 changes: 7 additions & 9 deletions openpype/hosts/maya/plugins/publish/extract_thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@


class ExtractThumbnail(openpype.api.Extractor):
"""Extract a Camera as Alembic.
"""Extract viewport thumbnail.

The cameras gets baked to world space by default. Only when the instance's
`bakeToWorldSpace` is set to False it will include its full hierarchy.
Takes review camera and creates a thumbnail based on viewport
capture.

"""

Expand All @@ -35,9 +35,10 @@ def process(self, instance):

try:
preset = lib.load_capture_preset(data=capture_preset)
except:
except KeyError as ke:
self.log.error('Error loading capture presets: {}'.format(str(ke)))
preset = {}
self.log.info('using viewport preset: {}'.format(capture_preset))
self.log.info('Using viewport preset: {}'.format(preset))

# preset["off_screen"] = False

Expand Down Expand Up @@ -78,7 +79,7 @@ def process(self, instance):

# Isolate view is requested by having objects in the set besides a
# camera.
if instance.data.get("isolate"):
if preset.pop("isolate_view", False) or instance.data.get("isolate"):
preset["isolate"] = instance.data["setMembers"]

with maintained_time():
Expand All @@ -89,9 +90,6 @@ def process(self, instance):
# playblast and viewer
preset['viewer'] = False

# Remove panel key since it's internal value to capture_gui
preset.pop("panel", None)

path = capture.capture(**preset)
playblast = self._fix_playblast_output_path(path)

Expand Down
29 changes: 0 additions & 29 deletions openpype/vendor/python/common/capture_gui/__init__.py

This file was deleted.

Loading