mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge branch 'develop' into enhancement/ruff-add-preview
This commit is contained in:
commit
fb8ee108b5
1 changed files with 9 additions and 5 deletions
|
|
@ -163,9 +163,12 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
||||||
# Store new staging to cleanup paths
|
# Store new staging to cleanup paths
|
||||||
instance.context.data["cleanupFullPaths"].append(dst_staging)
|
instance.context.data["cleanupFullPaths"].append(dst_staging)
|
||||||
|
|
||||||
thumbnail_created = False
|
|
||||||
oiio_supported = is_oiio_supported()
|
oiio_supported = is_oiio_supported()
|
||||||
|
thumbnail_created = False
|
||||||
for repre in filtered_repres:
|
for repre in filtered_repres:
|
||||||
|
# Reset for each iteration to handle cases where multiple
|
||||||
|
# reviewable thumbnails are needed
|
||||||
|
repre_thumb_created = False
|
||||||
repre_files = repre["files"]
|
repre_files = repre["files"]
|
||||||
src_staging = os.path.normpath(repre["stagingDir"])
|
src_staging = os.path.normpath(repre["stagingDir"])
|
||||||
if not isinstance(repre_files, (list, tuple)):
|
if not isinstance(repre_files, (list, tuple)):
|
||||||
|
|
@ -214,7 +217,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
||||||
)
|
)
|
||||||
# If the input can read by OIIO then use OIIO method for
|
# If the input can read by OIIO then use OIIO method for
|
||||||
# conversion otherwise use ffmpeg
|
# conversion otherwise use ffmpeg
|
||||||
thumbnail_created = self._create_thumbnail_oiio(
|
repre_thumb_created = self._create_thumbnail_oiio(
|
||||||
full_input_path,
|
full_input_path,
|
||||||
full_output_path,
|
full_output_path,
|
||||||
colorspace_data
|
colorspace_data
|
||||||
|
|
@ -223,21 +226,22 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
||||||
# Try to use FFMPEG if OIIO is not supported or for cases when
|
# Try to use FFMPEG if OIIO is not supported or for cases when
|
||||||
# oiiotool isn't available or representation is not having
|
# oiiotool isn't available or representation is not having
|
||||||
# colorspace data
|
# colorspace data
|
||||||
if not thumbnail_created:
|
if not repre_thumb_created:
|
||||||
if oiio_supported:
|
if oiio_supported:
|
||||||
self.log.debug(
|
self.log.debug(
|
||||||
"Converting with FFMPEG because input"
|
"Converting with FFMPEG because input"
|
||||||
" can't be read by OIIO."
|
" can't be read by OIIO."
|
||||||
)
|
)
|
||||||
|
|
||||||
thumbnail_created = self._create_thumbnail_ffmpeg(
|
repre_thumb_created = self._create_thumbnail_ffmpeg(
|
||||||
full_input_path, full_output_path
|
full_input_path, full_output_path
|
||||||
)
|
)
|
||||||
|
|
||||||
# Skip representation and try next one if wasn't created
|
# Skip representation and try next one if wasn't created
|
||||||
if not thumbnail_created:
|
if not repre_thumb_created:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
thumbnail_created = True
|
||||||
if len(explicit_repres) > 1:
|
if len(explicit_repres) > 1:
|
||||||
repre_name = "thumbnail_{}".format(repre["outputName"])
|
repre_name = "thumbnail_{}".format(repre["outputName"])
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue