mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +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"
|
label = "Attributes"
|
||||||
hosts = ["maya"]
|
hosts = ["maya"]
|
||||||
actions = [pype.api.RepairContextAction]
|
actions = [pype.api.RepairContextAction]
|
||||||
|
optional = True
|
||||||
|
|
||||||
def process(self, context):
|
def process(self, context):
|
||||||
# Check for preset existence.
|
# Check for preset existence.
|
||||||
|
|
@ -74,8 +75,12 @@ class ValidateAttributes(pyblish.api.ContextPlugin):
|
||||||
|
|
||||||
presets_to_validate = attributes[name]
|
presets_to_validate = attributes[name]
|
||||||
for attribute in node.listAttr():
|
for attribute in node.listAttr():
|
||||||
if attribute.attrName() in presets_to_validate:
|
names = [attribute.shortName(), attribute.longName()]
|
||||||
expected = presets_to_validate[attribute.attrName()]
|
attribute_name = list(
|
||||||
|
set(names) & set(presets_to_validate.keys())
|
||||||
|
)
|
||||||
|
if attribute_name:
|
||||||
|
expected = presets_to_validate[attribute_name[0]]
|
||||||
if attribute.get() != expected:
|
if attribute.get() != expected:
|
||||||
invalid_attributes.append(
|
invalid_attributes.append(
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue