mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #277 from tokejepsen/2.x/feature/validate_shots
Validate shots
This commit is contained in:
commit
c57e0585e3
1 changed files with 23 additions and 0 deletions
23
pype/plugins/standalonepublisher/publish/validate_shots.py
Normal file
23
pype/plugins/standalonepublisher/publish/validate_shots.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue