mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Re-use maintained_time from lib
This commit is contained in:
parent
a99cc8f497
commit
0e8892e281
2 changed files with 2 additions and 23 deletions
|
|
@ -1,6 +1,4 @@
|
|||
import os
|
||||
import glob
|
||||
import contextlib
|
||||
import clique
|
||||
import capture
|
||||
|
||||
|
|
@ -90,7 +88,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
|
||||
|
|
@ -153,12 +151,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
|
||||
|
|
@ -81,7 +80,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():
|
||||
with lib.maintained_time():
|
||||
filename = preset.get("filename", "%TEMP%")
|
||||
|
||||
# Force viewer to False in call to capture because we have our own
|
||||
|
|
@ -152,12 +151,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