Re-use maintained_time from lib

This commit is contained in:
Roy Nieterau 2022-06-29 11:33:24 +02:00
parent a99cc8f497
commit 0e8892e281
2 changed files with 2 additions and 23 deletions

View file

@ -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)

View file

@ -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)