OP-3951 - merged global validator and unreal one

Both should do same thing. Combination of host and family should be safe.
This commit is contained in:
Petr Kalis 2023-03-23 18:11:28 +01:00
parent 3860fe3692
commit e8f9c130bb
2 changed files with 2 additions and 43 deletions

View file

@ -1,41 +0,0 @@
import clique
import pyblish.api
class ValidateSequenceFrames(pyblish.api.InstancePlugin):
"""Ensure the sequence of frames is complete
The files found in the folder are checked against the frameStart and
frameEnd of the instance. If the first or last file is not
corresponding with the first or last frame it is flagged as invalid.
"""
order = pyblish.api.ValidatorOrder
label = "Validate Sequence Frames"
families = ["render"]
hosts = ["unreal"]
optional = True
def process(self, instance):
representations = instance.data.get("representations")
for repr in representations:
patterns = [clique.PATTERNS["frames"]]
collections, remainder = clique.assemble(
repr["files"], minimum_items=1, patterns=patterns)
assert not remainder, "Must not have remainder"
assert len(collections) == 1, "Must detect single collection"
collection = collections[0]
frames = list(collection.indexes)
current_range = (frames[0], frames[-1])
required_range = (instance.data["frameStart"],
instance.data["frameEnd"])
if current_range != required_range:
raise ValueError(f"Invalid frame range: {current_range} - "
f"expected: {required_range}")
missing = collection.holes().indexes
assert not missing, "Missing frames: %s" % (missing,)

View file

@ -21,8 +21,8 @@ class ValidateSequenceFrames(pyblish.api.InstancePlugin):
order = pyblish.api.ValidatorOrder order = pyblish.api.ValidatorOrder
label = "Validate Sequence Frames" label = "Validate Sequence Frames"
families = ["imagesequence"] families = ["imagesequence", "render"]
hosts = ["shell"] hosts = ["shell", "unreal"]
def process(self, instance): def process(self, instance):
representations = instance.data.get("representations") representations = instance.data.get("representations")