mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fix integrate thumbnail
This commit is contained in:
parent
66adf30a9b
commit
24f65f4d90
1 changed files with 13 additions and 10 deletions
|
|
@ -133,27 +133,30 @@ class IntegrateThumbnailsAYON(pyblish.api.ContextPlugin):
|
|||
for repre_info in published_representations.values():
|
||||
return repre_info["representation"]["versionId"]
|
||||
|
||||
def _get_instance_thumbnail_path(self, published_representations):
|
||||
thumb_repre_doc = None
|
||||
def _get_instance_thumbnail_path(
|
||||
self, published_representations, anatomy
|
||||
):
|
||||
thumb_repre_entity = None
|
||||
for repre_info in published_representations.values():
|
||||
repre_doc = repre_info["representation"]
|
||||
if "thumbnail" in repre_doc["name"].lower():
|
||||
thumb_repre_doc = repre_doc
|
||||
repre_entity = repre_info["representation"]
|
||||
if "thumbnail" in repre_entity["name"].lower():
|
||||
thumb_repre_entity = repre_entity
|
||||
break
|
||||
|
||||
if thumb_repre_doc is None:
|
||||
if thumb_repre_entity is None:
|
||||
self.log.debug(
|
||||
"There is no representation with name \"thumbnail\""
|
||||
)
|
||||
return None
|
||||
|
||||
path = thumb_repre_doc["data"]["path"]
|
||||
if not os.path.exists(path):
|
||||
path = thumb_repre_entity["attrib"]["path"]
|
||||
filled_path = anatomy.fill_root(path)
|
||||
if not os.path.exists(filled_path):
|
||||
self.log.warning(
|
||||
"Thumbnail file cannot be found. Path: {}".format(path)
|
||||
"Thumbnail file cannot be found. Path: {}".format(filled_path)
|
||||
)
|
||||
return None
|
||||
return os.path.normpath(path)
|
||||
return os.path.normpath(filled_path)
|
||||
|
||||
def _integrate_thumbnails(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue