mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
Merged in tokejepsen/pype/bugfix/maya_validate_attributes (pull request #276)
Long/Short attribute names and plugin optional Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
commit
ca2ee7adcb
1 changed files with 7 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ class ValidateAttributes(pyblish.api.ContextPlugin):
|
|||
label = "Attributes"
|
||||
hosts = ["maya"]
|
||||
actions = [pype.api.RepairContextAction]
|
||||
optional = True
|
||||
|
||||
def process(self, context):
|
||||
# Check for preset existence.
|
||||
|
|
@ -74,8 +75,12 @@ class ValidateAttributes(pyblish.api.ContextPlugin):
|
|||
|
||||
presets_to_validate = attributes[name]
|
||||
for attribute in node.listAttr():
|
||||
if attribute.attrName() in presets_to_validate:
|
||||
expected = presets_to_validate[attribute.attrName()]
|
||||
names = [attribute.shortName(), attribute.longName()]
|
||||
attribute_name = list(
|
||||
set(names) & set(presets_to_validate.keys())
|
||||
)
|
||||
if attribute_name:
|
||||
expected = presets_to_validate[attribute_name[0]]
|
||||
if attribute.get() != expected:
|
||||
invalid_attributes.append(
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue