-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pyblish.api | ||
from maya import cmds | ||
|
||
|
||
class ValidateKeysNone(pyblish.api.Validator): | ||
""" Validates that none of the nodes in the instance have any keys """ | ||
families = ['model', 'layout'] | ||
hosts = ['maya'] | ||
category = 'cleanup' | ||
optional = True | ||
version = (0, 1, 0) | ||
|
||
def process_instance(self, instance): | ||
"""Process all the nodes in the instance """ | ||
|
||
# quick check | ||
any_keys = cmds.keyframe(instance, q=1, selected=False) | ||
if not any_keys: | ||
return | ||
|
||
# find each individual node with keys | ||
invalid = [] | ||
for node in instance: | ||
keys = cmds.keyframe(node, q=1, selected=False) | ||
if keys: | ||
invalid.append(node) | ||
|
||
if invalid: | ||
raise ValueError("Nodes with keys found: {0}".format(invalid)) |