mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #3460 from BigRoy/cleanup_reuse_maintained_time
This commit is contained in:
commit
c84373fb58
2 changed files with 2 additions and 24 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue