Update openpype/hosts/traypublisher/plugins/publish/validate_frame_ranges.py

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
Petr Kalis 2022-07-18 10:57:01 +02:00 committed by GitHub
parent cdabfbe6f9
commit ef2284e507
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,18 +43,19 @@ class ValidateFrameRange(OptionalPyblishPluginMixin,
handle_end = asset_data["handleEnd"]
duration = (frame_end - frame_start + 1) + handle_start + handle_end
repre = instance.data.get("representations", [None])
if not repre:
repres = instance.data.get("representations")
if not repres:
self.log.info("No representations, skipping.")
return
ext = repre[0]['ext'].replace(".", '')
first_repre = repres[0]
ext = first_repre['ext'].replace(".", '')
if not ext or ext.lower() not in self.check_extensions:
self.log.warning("Cannot check for extension {}".format(ext))
return
files = instance.data.get("representations", [None])[0]["files"]
files = first_repre["files"]
if isinstance(files, str):
files = [files]
frames = len(files)