From 331ec6bf9d0eea58c12d7f1cfbca7cf67a1796a8 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 12 Jan 2023 11:01:53 +0100 Subject: [PATCH] OP-4617 - added new plugin to expose field for frames to fix Collector should get triggered for render family and offer field to input frames that should be re-rendered and replaced ones in latest version --- .../plugins/publish/collect_frames_fix.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 openpype/plugins/publish/collect_frames_fix.py diff --git a/openpype/plugins/publish/collect_frames_fix.py b/openpype/plugins/publish/collect_frames_fix.py new file mode 100644 index 0000000000..1e73f2caaa --- /dev/null +++ b/openpype/plugins/publish/collect_frames_fix.py @@ -0,0 +1,29 @@ +import pyblish.api +from openpype.lib.attribute_definitions import TextDef +from openpype.pipeline.publish import OpenPypePyblishPluginMixin + + +class CollectFramesFixDef( + pyblish.api.ContextPlugin, + OpenPypePyblishPluginMixin +): + label = "Collect frames to fix" + targets = ["local"] + # Disable plugin by default + families = ["render"] + enabled = True + + def process(self, instance): + attribute_values = self.get_attr_values_from_data(instance.data) + frames_to_fix = attribute_values.get("frames_to_fix") + if frames_to_fix: + instance.data["frames_to_fix"] = frames_to_fix + + @classmethod + def get_attribute_defs(cls): + return [ + TextDef("frames_to_fix", label="Frames to fix", + placeholder="5,10-15", + regex="[0-9,-]+") + ] +