clean up code & make sure the ext of thumbnail representation aligns with the image format data setting

This commit is contained in:
Kayla Man 2023-10-23 17:24:18 +08:00
parent fe1fd463da
commit d9dd36d77a
2 changed files with 1 additions and 4 deletions

View file

@ -31,7 +31,6 @@ def viewport_camera(camera):
camera (str): viewport camera for review render
"""
original = rt.viewport.getCamera()
has_autoplay = rt.preferences.playPreviewWhenDone
if not original:
# if there is no original camera
# use the current camera as original
@ -39,11 +38,9 @@ def viewport_camera(camera):
review_camera = rt.getNodeByName(camera)
try:
rt.viewport.setCamera(review_camera)
rt.preferences.playPreviewWhenDone = False
yield
finally:
rt.viewport.setCamera(original)
rt.preferences.playPreviewWhenDone = has_autoplay
@contextlib.contextmanager

View file

@ -37,7 +37,7 @@ class ExtractThumbnail(publish.Extractor):
representation = {
"name": "thumbnail",
"ext": "png",
"ext": ext,
"files": thumbnail,
"stagingDir": staging_dir,
"thumbnail": True