mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Implement ValidateRenderImageRule
This commit is contained in:
parent
db34b11c26
commit
98edcac479
1 changed files with 26 additions and 0 deletions
|
|
@ -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"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue