Merge pull request #3460 from BigRoy/cleanup_reuse_maintained_time

This commit is contained in:
Milan Kolar 2022-07-05 08:10:14 +02:00 committed by GitHub
commit c84373fb58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 24 deletions

View file

@ -115,7 +115,7 @@ class ExtractPlayblast(openpype.api.Extractor):
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
@ -178,12 +178,3 @@ class ExtractPlayblast(openpype.api.Extractor):
'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)

View file

@ -1,5 +1,4 @@
import os
import contextlib
import glob
import capture
@ -28,7 +27,6 @@ class ExtractThumbnail(openpype.api.Extractor):
camera = instance.data['review_camera']
capture_preset = ""
capture_preset = (
instance.context.data["project_settings"]['maya']['publish']['ExtractPlayblast']['capture_preset']
)
@ -103,9 +101,7 @@ class ExtractThumbnail(openpype.api.Extractor):
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
@ -174,12 +170,3 @@ class ExtractThumbnail(openpype.api.Extractor):
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)