Log frame range mismatch instead of no clear error

This commit is contained in:
Roy Nieterau 2018-07-20 23:34:13 +02:00
parent aa7bf8c0b9
commit 0db2f87e8e

View file

@ -17,12 +17,18 @@ class ValidateSequenceFrames(pyblish.api.InstancePlugin):
def process(self, instance):
collection = instance[0]
self.log.info(collection)
self.log.warning(collection)
frames = list(collection.indexes)
assert frames[0] == instance.data["startFrame"]
assert frames[-1] == instance.data["endFrame"]
current_range = (frames[0], frames[-1])
required_range = (instance.data["startFrame"],
instance.data["endFrame"])
if current_range != required_range:
raise ValueError("Invalid frame range: {0} - "
"expected: {1}".format(current_range,
required_range))
missing = collection.holes().indexes
assert not missing, "Missing frames: %s" % (missing,)