Last active
January 5, 2016 16:50
-
-
Save madoodia/136f685012b7742a3fce to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import pyblish.api | |
import nuke | |
class SelectMyInstance2(pyblish.api.Selector): | |
"""This is Documentation of SelectMyInstance2""" | |
hosts = ["nuke"] # Only compatible with Nuke | |
def process(self, context): | |
instance = context.create_instance(name="MyInstance") | |
instance.set_data("family", "my") | |
for node in nuke.selectedNodes(): | |
instance.add(node) | |
# ----------------------------- | |
import pyblish.api | |
@pyblish.api.log | |
class ValidateInstance(pyblish.api.Validator): | |
hosts = ["nuke"] | |
families = ["rig"] | |
def process(self, instance): | |
if not "MyNode" in instance: | |
raise pyblish.api.ValidationError("'MyNode' must exist in Maya scene") | |
mottosso
commented
Jan 5, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment