mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
improved get_invalid function
This commit is contained in:
parent
e34644e36d
commit
b1797f5921
1 changed files with 7 additions and 10 deletions
|
|
@ -29,26 +29,23 @@ class ValidateYetiRigCacheState(pyblish.api.InstancePlugin):
|
|||
@classmethod
|
||||
def get_invalid(cls, instance):
|
||||
|
||||
# As we check 2 attributes of per node it might be that both attrs
|
||||
# are wrong, therefor we use a set to ensure the user only gets unique
|
||||
# nodes in the reports. It also ensures we only have go over each node
|
||||
# once when repairing ;)
|
||||
invalid = set()
|
||||
invalid = []
|
||||
|
||||
yeti_nodes = cmds.ls(instance, type="pgYetiMaya")
|
||||
for node in yeti_nodes:
|
||||
# check reading state
|
||||
# Check reading state
|
||||
state = cmds.getAttr("%s.fileMode" % node)
|
||||
if state == 1:
|
||||
cls.log.error("Node `%s` is set to mode `cache`" % node)
|
||||
invalid.add(node)
|
||||
invalid.append(node)
|
||||
continue
|
||||
|
||||
# Check reading state
|
||||
has_cache = cmds.getAttr("%s.cacheFileName" % node)
|
||||
if has_cache:
|
||||
cls.log.error("Node `%s` has a ")
|
||||
invalid.add(node)
|
||||
|
||||
invalid = list(invalid)
|
||||
invalid.append(node)
|
||||
continue
|
||||
|
||||
return invalid
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue