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 #3460 from BigRoy/cleanup_reuse_maintained_time
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolar authored Jul 5, 2022
2 parents 8a52e70 + c8fb351 commit c84373f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
11 changes: 1 addition & 10 deletions openpype/hosts/maya/plugins/publish/extract_playblast.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def process(self, instance):
else:
preset["viewport_options"] = {"imagePlane": image_plane}

with maintained_time():
with lib.maintained_time():
filename = preset.get("filename", "%TEMP%")

# Force viewer to False in call to capture because we have our own
Expand Down Expand Up @@ -178,12 +178,3 @@ def process(self, instance):
'camera_name': camera_node_name
}
instance.data["representations"].append(representation)


@contextlib.contextmanager
def maintained_time():
ct = cmds.currentTime(query=True)
try:
yield
finally:
cmds.currentTime(ct, edit=True)
15 changes: 1 addition & 14 deletions openpype/hosts/maya/plugins/publish/extract_thumbnail.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import contextlib
import glob

import capture
Expand Down Expand Up @@ -28,7 +27,6 @@ def process(self, instance):

camera = instance.data['review_camera']

capture_preset = ""
capture_preset = (
instance.context.data["project_settings"]['maya']['publish']['ExtractPlayblast']['capture_preset']
)
Expand Down Expand Up @@ -103,9 +101,7 @@ def process(self, instance):
if preset.pop("isolate_view", False) and instance.data.get("isolate"):
preset["isolate"] = instance.data["setMembers"]

with maintained_time():
filename = preset.get("filename", "%TEMP%")

with lib.maintained_time():
# Force viewer to False in call to capture because we have our own
# viewer opening call to allow a signal to trigger between
# playblast and viewer
Expand Down Expand Up @@ -174,12 +170,3 @@ def _fix_playblast_output_path(self, filepath):
filepath = max(files, key=os.path.getmtime)

return filepath


@contextlib.contextmanager
def maintained_time():
ct = cmds.currentTime(query=True)
try:
yield
finally:
cmds.currentTime(ct, edit=True)

0 comments on commit c84373f

Please sign in to comment.