add new representation only if was created

This commit is contained in:
Jakub Trllo 2022-06-16 11:35:57 +02:00
parent 8909bd8901
commit eb3e0d6265

View file

@ -92,17 +92,19 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
return
new_repre = {
"name": "thumbnail",
"ext": "jpg",
"files": jpeg_file,
"stagingDir": stagingdir,
"thumbnail": True,
"tags": ["thumbnail"]
}
"name": "thumbnail",
"ext": "jpg",
"files": jpeg_file,
"stagingDir": stagingdir,
"thumbnail": True,
"tags": ["thumbnail"]
}
# adding representation
self.log.debug("Adding: {}".format(new_repre))
instance.data["representations"].append(new_repre)
# adding representation
self.log.debug(
"Adding thumbnail representation: {}".format(new_repre)
)
instance.data["representations"].append(new_repre)
def _get_filtered_repres(self, instance):
filtered_repres = []