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

Commit

Permalink
Merge pull request #1617 from 2-REC-forks/bc/fix/capture
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolar authored Jun 2, 2021
2 parents 76aeffb + 946f2ac commit b5bb8a7
Show file tree
Hide file tree
Showing 29 changed files with 10 additions and 5,203 deletions.
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 @@ -2224,16 +2220,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 @@ -72,7 +72,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 @@ -90,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)

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 @@ -74,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"]

with maintained_time():
Expand All @@ -85,9 +86,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

0 comments on commit b5bb8a7

Please sign in to comment.