Merge pull request #3176 from pypeclub/bugfix/avoid_same_name_representations_dev

General: Avoid creating multiple thumbnails
This commit is contained in:
Jakub Trllo 2022-05-13 10:50:55 +02:00 committed by GitHub
commit 00e99b67f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,7 @@ class ExtractJpegEXR(pyblish.api.InstancePlugin):
return
filtered_repres = self._get_filtered_repres(instance)
for repre in filtered_repres:
repre_files = repre["files"]
if not isinstance(repre_files, (list, tuple)):
@ -151,6 +152,11 @@ class ExtractJpegEXR(pyblish.api.InstancePlugin):
if convert_dir is not None and os.path.exists(convert_dir):
shutil.rmtree(convert_dir)
# Create only one representation with name 'thumbnail'
# TODO maybe handle way how to decide from which representation
# will be thumbnail created
break
def _get_filtered_repres(self, instance):
filtered_repres = []
src_repres = instance.data.get("representations") or []