Implement ValidateRenderImageRule

This commit is contained in:
Roy Nieterau 2017-10-04 18:02:52 +02:00
parent db34b11c26
commit 98edcac479

View file

@ -0,0 +1,26 @@
import maya.mel as mel
import pyblish.api
import colorbleed.api
def get_file_rule(rule):
"""Workaround for a bug in python with cmds.workspace"""
return mel.eval('workspace -query -fileRuleEntry "{}"'.format(rule))
class ValidateRenderImageRule(pyblish.api.ContextPlugin):
"""Validates "images" file rule is set to "renders/"
"""
order = colorbleed.api.ValidateContentsOrder
label = "Images File Rule (Workspace)"
hosts = ["maya"]
families = ["colorbleed.renderlayer"]
def process(self, context):
assert get_file_rule("images") == "renders", (
"Workspace's `images` file rule must be set to: renders"
)