mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Simplify logic in thumbnail extractor.
This commit is contained in:
parent
c67308d032
commit
bc18f8f755
1 changed files with 10 additions and 13 deletions
|
|
@ -65,26 +65,23 @@ class ExtractThumbnail(openpype.api.Extractor):
|
|||
width_preset = capture_presets["Resolution"]["width"]
|
||||
height_preset = capture_presets["Resolution"]["height"]
|
||||
# Set resolution variables from asset values
|
||||
asset_width = instance.data.get("resolutionWidth")
|
||||
asset_height = instance.data.get("resolutionHeight")
|
||||
review_instance_width = instance.data.get("instanceWidth")
|
||||
review_instance_height = instance.data.get("instanceHeight")
|
||||
asset_data = instance.data["assetEntity"]["data"]
|
||||
asset_width = asset_data.get("width")
|
||||
asset_height = asset_data.get("height")
|
||||
review_instance_width = instance.data.get("Width")
|
||||
review_instance_height = instance.data.get("Height")
|
||||
# Tests if project resolution is set,
|
||||
# if it is a value other than zero, that value is
|
||||
# used, if not then the asset resolution is
|
||||
# used
|
||||
if review_instance_width != 0:
|
||||
if review_instance_width and review_instance_height:
|
||||
preset['width'] = review_instance_width
|
||||
elif width_preset == 0:
|
||||
preset['width'] = asset_width
|
||||
elif width_preset != 0:
|
||||
preset['width'] = width_preset
|
||||
|
||||
if review_instance_height != 0:
|
||||
preset['height'] = review_instance_height
|
||||
elif height_preset == 0:
|
||||
elif asset_width and asset_height:
|
||||
preset['width'] = asset_width
|
||||
preset['height'] = asset_height
|
||||
elif height_preset != 0:
|
||||
elif width_preset and height_preset:
|
||||
preset['width'] = width_preset
|
||||
preset['height'] = height_preset
|
||||
stagingDir = self.staging_dir(instance)
|
||||
filename = "{0}".format(instance.name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue