mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #3517 from pypeclub/chore/OP-3589_TrayPublisher-Create-thumbnail
Traypublisher: added thumbnail extract
This commit is contained in:
commit
396079985d
1 changed files with 13 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
|||
"imagesequence", "render", "render2d", "prerender",
|
||||
"source", "plate", "take"
|
||||
]
|
||||
hosts = ["shell", "fusion", "resolve"]
|
||||
hosts = ["shell", "fusion", "resolve", "traypublisher"]
|
||||
enabled = False
|
||||
|
||||
# presetable attribute
|
||||
|
|
@ -46,6 +46,10 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
|||
self.log.info("Skipping - no review set on instance.")
|
||||
return
|
||||
|
||||
if self._already_has_thumbnail(instance):
|
||||
self.log.info("Thumbnail representation already present.")
|
||||
return
|
||||
|
||||
filtered_repres = self._get_filtered_repres(instance)
|
||||
for repre in filtered_repres:
|
||||
repre_files = repre["files"]
|
||||
|
|
@ -102,6 +106,14 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
|
|||
# There is no need to create more then one thumbnail
|
||||
break
|
||||
|
||||
def _already_has_thumbnail(self, instance):
|
||||
for repre in instance.data.get("representations", []):
|
||||
self.log.info("repre {}".format(repre))
|
||||
if repre["name"] == "thumbnail":
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def _get_filtered_repres(self, instance):
|
||||
filtered_repres = []
|
||||
src_repres = instance.data.get("representations") or []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue