diff --git a/colorbleed/plugins/houdini/publish/validate_mkpaths_toggled.py b/colorbleed/plugins/houdini/publish/validate_mkpaths_toggled.py new file mode 100644 index 0000000000..8dcc6e0509 --- /dev/null +++ b/colorbleed/plugins/houdini/publish/validate_mkpaths_toggled.py @@ -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 + +