mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
23 lines
673 B
Python
23 lines
673 B
Python
import pyblish.api
|
|
import pype.api
|
|
|
|
|
|
class ValidateShots(pyblish.api.ContextPlugin):
|
|
"""Validate there is a "mov" next to the editorial file."""
|
|
|
|
label = "Validate Shots"
|
|
hosts = ["standalonepublisher"]
|
|
order = pype.api.ValidateContentsOrder
|
|
|
|
def process(self, context):
|
|
shot_names = []
|
|
duplicate_names = []
|
|
for instance in context:
|
|
name = instance.data["name"]
|
|
if name in shot_names:
|
|
duplicate_names.append(name)
|
|
else:
|
|
shot_names.append(name)
|
|
|
|
msg = "There are duplicate shot names:\n{}".format(duplicate_names)
|
|
assert not duplicate_names, msg
|