mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
Added validator to check for create intermediate dir toggle
This commit is contained in:
parent
f7d8642718
commit
5da32ff95f
1 changed files with 38 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
import pyblish.api
|
||||
import colorbleed.api
|
||||
|
||||
|
||||
class ValidatIntermediateDirectoriesChecked(pyblish.api.InstancePlugin):
|
||||
"""Validate if node attribute Create intermediate Directories is turned on
|
||||
|
||||
Rules:
|
||||
* The node must have Create intermediate Directories turned on to
|
||||
ensure the output file will be created
|
||||
|
||||
"""
|
||||
|
||||
order = colorbleed.api.ValidateContentsOrder
|
||||
families = ['colorbleed.pointcache']
|
||||
hosts = ['houdini']
|
||||
label = 'Create Intermediate Directories Checked'
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
raise RuntimeError("Found ROP nodes with Create Intermediate "
|
||||
"Directories turned off")
|
||||
|
||||
@classmethod
|
||||
def get_invalid(cls, instance):
|
||||
|
||||
result = []
|
||||
|
||||
for node in instance[:]:
|
||||
if node.parm("mkpath").eval() != 1:
|
||||
cls.log.error("Invalid settings found on `%s`" % node.path())
|
||||
result.append(node.path())
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue