diff --git a/colorbleed/plugins/fusion/publish/publish_image_sequences.py b/colorbleed/plugins/fusion/publish/publish_image_sequences.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/colorbleed/plugins/fusion/publish/validate_filename_has_extension.py b/colorbleed/plugins/fusion/publish/validate_filename_has_extension.py new file mode 100644 index 0000000000..18f1649756 --- /dev/null +++ b/colorbleed/plugins/fusion/publish/validate_filename_has_extension.py @@ -0,0 +1,37 @@ +import os + +import pyblish.api + + +class ValidateFilenameHasExtension(pyblish.api.InstancePlugin): + """Ensure the Saver has an extension in the filename path + + This is to counter any possible file being written as `filename` instead + of `filename.frame.ext`. + Fusion does not set an extension for your filename + when changing the file format of the saver. + """ + + order = pyblish.api.ValidatorOrder + label = "Validate Filename Has Extension" + families = ["fusion.deadline", "colorbleed.imagesequence"] + hosts = ["fusion"] + + def process(self, instance): + invalid = self.get_invalid(instance) + if invalid: + raise RuntimeError("Found Saver(s) without a extesions") + + @classmethod + def get_invalid(cls, instance): + + path = instance.data["path"] + fname, ext = os.path.splitext(path) + + if not ext: + cls.log.error("%s has no extension specified" % + instance[0].Name) + # Return the tool + return [instance[0]] + + return []