mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Remove photoshop validate unique subsets in favor of global one
This commit is contained in:
parent
9df7d43cda
commit
be715734d4
2 changed files with 0 additions and 53 deletions
|
|
@ -1,14 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<root>
|
|
||||||
<error id="main">
|
|
||||||
<title>Subset not unique</title>
|
|
||||||
<description>
|
|
||||||
## Non unique subset name found
|
|
||||||
|
|
||||||
Non unique subset names: '{non_unique}'
|
|
||||||
### How to repair?
|
|
||||||
|
|
||||||
Remove offending instance, rename it to have unique name. Maybe layer name wasn't used for multiple instances?
|
|
||||||
</description>
|
|
||||||
</error>
|
|
||||||
</root>
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
import collections
|
|
||||||
import pyblish.api
|
|
||||||
from openpype.pipeline.publish import (
|
|
||||||
ValidateContentsOrder,
|
|
||||||
PublishXmlValidationError,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ValidateSubsetUniqueness(pyblish.api.ContextPlugin):
|
|
||||||
"""
|
|
||||||
Validate that all subset's names are unique.
|
|
||||||
"""
|
|
||||||
|
|
||||||
label = "Validate Subset Uniqueness"
|
|
||||||
hosts = ["photoshop"]
|
|
||||||
order = ValidateContentsOrder
|
|
||||||
families = ["image"]
|
|
||||||
|
|
||||||
def process(self, context):
|
|
||||||
subset_names = []
|
|
||||||
|
|
||||||
for instance in context:
|
|
||||||
self.log.info("instance:: {}".format(instance.data))
|
|
||||||
if instance.data.get('publish'):
|
|
||||||
subset_names.append(instance.data.get('subset'))
|
|
||||||
|
|
||||||
non_unique = \
|
|
||||||
[item
|
|
||||||
for item, count in collections.Counter(subset_names).items()
|
|
||||||
if count > 1]
|
|
||||||
msg = ("Instance subset names {} are not unique. ".format(non_unique) +
|
|
||||||
"Remove duplicates via SubsetManager.")
|
|
||||||
formatting_data = {
|
|
||||||
"non_unique": ",".join(non_unique)
|
|
||||||
}
|
|
||||||
|
|
||||||
if non_unique:
|
|
||||||
raise PublishXmlValidationError(self, msg,
|
|
||||||
formatting_data=formatting_data)
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue