From a864b80862d91ace2d46e23aa1fbb10b8a6a7481 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 14 Mar 2022 15:53:41 +0100 Subject: [PATCH 01/12] flame: convert segment comment to attributes wip --- .../hosts/flame/plugins/publish/collect_timeline_instances.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index 6424bce3bc9..54ff543f21f 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -16,6 +16,9 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): audio_track_items = [] + def _get_comment_attributes(self, segment): + comment = segment.comment.get_value() + def process(self, context): project = context.data["flameProject"] sequence = context.data["flameSequence"] @@ -26,6 +29,7 @@ def process(self, context): # process all sellected with opfapi.maintained_segment_selection(sequence) as segments: for segment in segments: + comment_attributes = self._get_comment_attributes(segment) clip_data = opfapi.get_segment_attributes(segment) clip_name = clip_data["segment_name"] self.log.debug("clip_name: {}".format(clip_name)) From 34b44bec6306c807c3c652872d5b53b8838b0e11 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 14 Mar 2022 19:36:25 +0100 Subject: [PATCH 02/12] flame: resolving attributes from segment comments --- .../publish/collect_timeline_instances.py | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index 54ff543f21f..9e6c7210fbb 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -1,3 +1,4 @@ +import re import pyblish import openpype import openpype.hosts.flame.api as opfapi @@ -16,9 +17,6 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): audio_track_items = [] - def _get_comment_attributes(self, segment): - comment = segment.comment.get_value() - def process(self, context): project = context.data["flameProject"] sequence = context.data["flameSequence"] @@ -30,6 +28,9 @@ def process(self, context): with opfapi.maintained_segment_selection(sequence) as segments: for segment in segments: comment_attributes = self._get_comment_attributes(segment) + self.log.debug("_ comment_attributes: {}".format( + pformat(comment_attributes))) + clip_data = opfapi.get_segment_attributes(segment) clip_name = clip_data["segment_name"] self.log.debug("clip_name: {}".format(clip_name)) @@ -130,6 +131,44 @@ def process(self, context): if marker_data.get("reviewTrack") is not None: instance.data["reviewAudio"] = True + def _get_comment_attributes(self, segment): + comment = segment.comment.get_value() + + # first split comment by comma + split_comments = [] + if "," in comment: + split_comments.extend(iter(comment.split(","))) + elif ";" in comment: + split_comments.extend(iter(comment.split(";"))) + else: + split_comments.append(comment) + + # try to find attributes + attributes = {} + # search for `:` + for split in split_comments: + # make sure we ignore if not `:` in key + if ":" not in split: + continue + + # split to key and value + key, value = split.split(":") + + # condition for resolution in key + if "resolution" in key.lower(): + patern = re.compile(r"([0-9]+)") + res_goup = patern.findall(value) + + # check if axpect was also defined + # 1920x1080x1.5 + aspect = res_goup[2] if len(res_goup) > 2 else 1 + + attributes["resolution"] = { + "width": int(res_goup[0]), + "height": int(res_goup[1]), + "pixelAspect": float(aspect) + } + def _get_head_tail(self, clip_data, first_frame): # calculate head and tail with forward compatibility head = clip_data.get("segment_head") From bd57a0fd56f76c71328020eeaa29aec294ea7efb Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 14 Mar 2022 19:49:15 +0100 Subject: [PATCH 03/12] flame: add comment attributes to instance data --- .../plugins/publish/collect_timeline_instances.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index 9e6c7210fbb..dd446270216 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -106,6 +106,9 @@ def process(self, context): # add resolution self._get_resolution_to_data(inst_data, context) + # add comment attributes if any + inst_data.update(comment_attributes) + # create instance instance = context.create_instance(**inst_data) @@ -163,11 +166,13 @@ def _get_comment_attributes(self, segment): # 1920x1080x1.5 aspect = res_goup[2] if len(res_goup) > 2 else 1 - attributes["resolution"] = { - "width": int(res_goup[0]), - "height": int(res_goup[1]), + attributes.update({ + "resolutionWidth": int(res_goup[0]), + "resolutionHeight": int(res_goup[1]), "pixelAspect": float(aspect) - } + }) + + return attributes def _get_head_tail(self, clip_data, first_frame): # calculate head and tail with forward compatibility From 420122b8c9ec5e3eeefe7f89e8627c06a30f6eed Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 14 Mar 2022 19:57:35 +0100 Subject: [PATCH 04/12] flame: fix regex to get float number too --- .../hosts/flame/plugins/publish/collect_timeline_instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index dd446270216..f41f7738028 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -159,7 +159,7 @@ def _get_comment_attributes(self, segment): # condition for resolution in key if "resolution" in key.lower(): - patern = re.compile(r"([0-9]+)") + patern = re.compile(r"([0-9\.]+)") res_goup = patern.findall(value) # check if axpect was also defined From 0a7cbeef6df772531270755c93120dcb4fa20fad Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 15 Mar 2022 14:17:24 +0100 Subject: [PATCH 05/12] flame: refactor to settings configurability --- .../publish/collect_timeline_instances.py | 101 +++++++++++++----- 1 file changed, 75 insertions(+), 26 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index f41f7738028..e54ff9a1672 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -7,6 +7,10 @@ # # developer reload modules from pprint import pformat +# constatns +NUM_PATERN = re.compile(r"([0-9\.]+)") +TXT_PATERN = re.compile(r"([a-zA-Z]+)") + class CollectTimelineInstances(pyblish.api.ContextPlugin): """Collect all Timeline segment selection.""" @@ -17,6 +21,16 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): audio_track_items = [] + # TODO: add to settings + # settings + xml_preset_attrs_from_comments = { + "width": "number", + "height": "number", + "pixelRatio": "number", + "resizeType": "string", + "resizeFilter": "string" + } + def process(self, context): project = context.data["flameProject"] sequence = context.data["flameSequence"] @@ -137,42 +151,77 @@ def process(self, context): def _get_comment_attributes(self, segment): comment = segment.comment.get_value() - # first split comment by comma - split_comments = [] - if "," in comment: - split_comments.extend(iter(comment.split(","))) - elif ";" in comment: - split_comments.extend(iter(comment.split(";"))) - else: - split_comments.append(comment) - # try to find attributes - attributes = {} + attributes = { + "pixelRatio": 1.00 + } # search for `:` - for split in split_comments: + for split in self._split_comments(comment): # make sure we ignore if not `:` in key if ":" not in split: continue - # split to key and value - key, value = split.split(":") + self._get_xml_preset_attrs( + attributes, split) - # condition for resolution in key - if "resolution" in key.lower(): - patern = re.compile(r"([0-9\.]+)") - res_goup = patern.findall(value) + if attributes.get("width"): + attributes["resolution"] = { + "resolutionWidth": attributes["width"], + "resolutionHeight": attributes["height"], + "pixelAspect": attributes["pixelRatio"] + } - # check if axpect was also defined - # 1920x1080x1.5 - aspect = res_goup[2] if len(res_goup) > 2 else 1 + return attributes - attributes.update({ - "resolutionWidth": int(res_goup[0]), - "resolutionHeight": int(res_goup[1]), - "pixelAspect": float(aspect) - }) + def _get_xml_preset_attrs(self, attributes, split): - return attributes + # split to key and value + key, value = split.split(":") + + for a_name, a_type in self.xml_preset_attrs_from_comments.items(): + # exclude all not related attributes + if a_name.lower() not in key: + continue + + # get pattern defined by type + pattern = TXT_PATERN if "string" in a_type else NUM_PATERN + res_goup = pattern.findall(value) + + # raise if nothing is found as it is not correctly defined + if not res_goup: + raise ValueError(( + "Value for `{}` attribute is not " + "set correctly: `{}`").format(a_name, split)) + + attributes[a_name] = res_goup[0] + + # condition for resolution in key + if "resolution" in key.lower(): + res_goup = NUM_PATERN.findall(value) + # check if axpect was also defined + # 1920x1080x1.5 + aspect = res_goup[2] if len(res_goup) > 2 else 1 + + width = int(res_goup[0]) + height = int(res_goup[1]) + pixel_ratio = float(aspect) + attributes.update({ + "width": width, + "height": height, + "pixelRatio": pixel_ratio + }) + + def _split_comments(self, comment_string): + # first split comment by comma + split_comments = [] + if "," in comment_string: + split_comments.extend(iter(comment_string.split(","))) + elif ";" in comment_string: + split_comments.extend(iter(comment_string.split(";"))) + else: + split_comments.append(comment_string) + + return split_comments def _get_head_tail(self, clip_data, first_frame): # calculate head and tail with forward compatibility From d408139bb7a9753e0892d648819af4db6093e9e9 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 15 Mar 2022 14:26:08 +0100 Subject: [PATCH 06/12] flame: restructure data nesting for better absorption to instance data --- .../publish/collect_timeline_instances.py | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index e54ff9a1672..72ad2cd1c34 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -153,7 +153,8 @@ def _get_comment_attributes(self, segment): # try to find attributes attributes = { - "pixelRatio": 1.00 + "xml_overrides": { + "pixelRatio": 1.00} } # search for `:` for split in self._split_comments(comment): @@ -164,12 +165,14 @@ def _get_comment_attributes(self, segment): self._get_xml_preset_attrs( attributes, split) - if attributes.get("width"): - attributes["resolution"] = { - "resolutionWidth": attributes["width"], - "resolutionHeight": attributes["height"], - "pixelAspect": attributes["pixelRatio"] - } + # add xml overides resolution to instance data + xml_overrides = attributes["xml_overrides"] + if xml_overrides.get("width"): + attributes.update({ + "resolutionWidth": xml_overrides["width"], + "resolutionHeight": xml_overrides["height"], + "pixelAspect": xml_overrides["pixelRatio"] + }) return attributes @@ -193,7 +196,7 @@ def _get_xml_preset_attrs(self, attributes, split): "Value for `{}` attribute is not " "set correctly: `{}`").format(a_name, split)) - attributes[a_name] = res_goup[0] + attributes["xml_overrides"][a_name] = res_goup[0] # condition for resolution in key if "resolution" in key.lower(): @@ -205,7 +208,7 @@ def _get_xml_preset_attrs(self, attributes, split): width = int(res_goup[0]) height = int(res_goup[1]) pixel_ratio = float(aspect) - attributes.update({ + attributes["xml_overrides"].update({ "width": width, "height": height, "pixelRatio": pixel_ratio From 48ce34c58e960e458676bf215b21fb5416ad960d Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 15 Mar 2022 14:26:47 +0100 Subject: [PATCH 07/12] flame: add xml_overrides to extracting profiles --- .../flame/plugins/publish/extract_subset_resources.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openpype/hosts/flame/plugins/publish/extract_subset_resources.py b/openpype/hosts/flame/plugins/publish/extract_subset_resources.py index 5c3aed96720..194557e37a0 100644 --- a/openpype/hosts/flame/plugins/publish/extract_subset_resources.py +++ b/openpype/hosts/flame/plugins/publish/extract_subset_resources.py @@ -1,9 +1,11 @@ import os from pprint import pformat from copy import deepcopy + import pyblish.api import openpype.api from openpype.hosts.flame import api as opfapi +from pprint import pformat class ExtractSubsetResources(openpype.api.Extractor): @@ -131,6 +133,12 @@ def process(self, instance): "startFrame": frame_start }) + # add any xml overrides collected form segment.comment + modify_xml_data.update(instance.data["xml_overrides"]) + self.log.debug("__ modify_xml_data: {}".format(pformat( + modify_xml_data + ))) + # with maintained duplication loop all presets with opfapi.maintained_object_duplication( exporting_clip) as duplclip: From d867b872a894986579709718e2894596ed9e527a Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 16 Mar 2022 16:55:51 +0100 Subject: [PATCH 08/12] flame: distribute better value types --- .../publish/collect_timeline_instances.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index 72ad2cd1c34..44c25f04a22 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -26,7 +26,7 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): xml_preset_attrs_from_comments = { "width": "number", "height": "number", - "pixelRatio": "number", + "pixelRatio": "float", "resizeType": "string", "resizeFilter": "string" } @@ -183,11 +183,14 @@ def _get_xml_preset_attrs(self, attributes, split): for a_name, a_type in self.xml_preset_attrs_from_comments.items(): # exclude all not related attributes - if a_name.lower() not in key: + if a_name.lower() not in key.lower(): continue # get pattern defined by type - pattern = TXT_PATERN if "string" in a_type else NUM_PATERN + pattern = TXT_PATERN + if "number" in a_type or "float" in a_type: + pattern = NUM_PATERN + res_goup = pattern.findall(value) # raise if nothing is found as it is not correctly defined @@ -196,7 +199,14 @@ def _get_xml_preset_attrs(self, attributes, split): "Value for `{}` attribute is not " "set correctly: `{}`").format(a_name, split)) - attributes["xml_overrides"][a_name] = res_goup[0] + if "string" in a_type: + _value = res_goup[0] + if "float" in a_type: + _value = float(res_goup[0]) + if "number" in a_type: + _value = int(res_goup[0]) + + attributes["xml_overrides"][a_name] = _value # condition for resolution in key if "resolution" in key.lower(): From d98d8905afb1ae3a28af03904adc6b4e57114fff Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 16 Mar 2022 17:10:56 +0100 Subject: [PATCH 09/12] Flame: add ignoring toggle to settings parsed attributes from comments can be ignored now --- .../plugins/publish/extract_subset_resources.py | 14 +++++++++----- .../settings/defaults/project_settings/flame.json | 1 + .../projects_schema/schema_project_flame.json | 11 +++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/extract_subset_resources.py b/openpype/hosts/flame/plugins/publish/extract_subset_resources.py index 2e3b84def8e..ac50c7c9804 100644 --- a/openpype/hosts/flame/plugins/publish/extract_subset_resources.py +++ b/openpype/hosts/flame/plugins/publish/extract_subset_resources.py @@ -25,6 +25,7 @@ class ExtractSubsetResources(openpype.api.Extractor): "xml_preset_file": "Jpeg (8-bit).xml", "xml_preset_dir": "", "export_type": "File Sequence", + "ignore_comment_attrs": True, "colorspace_out": "Output - sRGB", "representation_add_range": False, "representation_tags": ["thumbnail"] @@ -34,6 +35,7 @@ class ExtractSubsetResources(openpype.api.Extractor): "xml_preset_file": "Apple iPad (1920x1080).xml", "xml_preset_dir": "", "export_type": "Movie", + "ignore_comment_attrs": True, "colorspace_out": "Output - Rec.709", "representation_add_range": True, "representation_tags": [ @@ -104,6 +106,7 @@ def process(self, instance): preset_dir = preset_config["xml_preset_dir"] export_type = preset_config["export_type"] repre_tags = preset_config["representation_tags"] + ignore_comment_attrs = preset_config["ignore_comment_attrs"] color_out = preset_config["colorspace_out"] # get frame range with handles for representation range @@ -133,11 +136,12 @@ def process(self, instance): "startFrame": frame_start }) - # add any xml overrides collected form segment.comment - modify_xml_data.update(instance.data["xml_overrides"]) - self.log.debug("__ modify_xml_data: {}".format(pformat( - modify_xml_data - ))) + if not ignore_comment_attrs: + # add any xml overrides collected form segment.comment + modify_xml_data.update(instance.data["xml_overrides"]) + self.log.debug("__ modify_xml_data: {}".format(pformat( + modify_xml_data + ))) # with maintained duplication loop all presets with opfapi.maintained_object_duplication( diff --git a/openpype/settings/defaults/project_settings/flame.json b/openpype/settings/defaults/project_settings/flame.json index ef9c2b1041b..c7188b10b5a 100644 --- a/openpype/settings/defaults/project_settings/flame.json +++ b/openpype/settings/defaults/project_settings/flame.json @@ -28,6 +28,7 @@ "xml_preset_file": "OpenEXR (16-bit fp DWAA).xml", "xml_preset_dir": "", "export_type": "File Sequence", + "ignore_comment_attrs": false, "colorspace_out": "ACES - ACEScg", "representation_add_range": true, "representation_tags": [] diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index 1f30b459815..e352f8b1327 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -189,6 +189,17 @@ ] }, + { + "type": "separator" + }, + { + "type": "boolean", + "key": "ignore_comment_attrs", + "label": "Ignore attributes parsed from a segment comments" + }, + { + "type": "separator" + }, { "key": "colorspace_out", "label": "Output color (imageio)", From 4b83446230d54a804fd2a509a709abab463c44cc Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 16 Mar 2022 17:42:27 +0100 Subject: [PATCH 10/12] flame: moving logging outside of condition --- .../flame/plugins/publish/extract_subset_resources.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/extract_subset_resources.py b/openpype/hosts/flame/plugins/publish/extract_subset_resources.py index ac50c7c9804..d52669d955b 100644 --- a/openpype/hosts/flame/plugins/publish/extract_subset_resources.py +++ b/openpype/hosts/flame/plugins/publish/extract_subset_resources.py @@ -139,9 +139,10 @@ def process(self, instance): if not ignore_comment_attrs: # add any xml overrides collected form segment.comment modify_xml_data.update(instance.data["xml_overrides"]) - self.log.debug("__ modify_xml_data: {}".format(pformat( - modify_xml_data - ))) + + self.log.debug("__ modify_xml_data: {}".format(pformat( + modify_xml_data + ))) # with maintained duplication loop all presets with opfapi.maintained_object_duplication( From d0a79e31f5afb8dcdd5bbcf7d376b89c98d29456 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 16 Mar 2022 17:44:01 +0100 Subject: [PATCH 11/12] hound and suggested changes --- .../hosts/flame/plugins/publish/collect_timeline_instances.py | 4 ++-- .../hosts/flame/plugins/publish/extract_subset_resources.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index 44c25f04a22..c6793874c0c 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -228,9 +228,9 @@ def _split_comments(self, comment_string): # first split comment by comma split_comments = [] if "," in comment_string: - split_comments.extend(iter(comment_string.split(","))) + split_comments.extend(comment_string.split(",")) elif ";" in comment_string: - split_comments.extend(iter(comment_string.split(";"))) + split_comments.extend(comment_string.split(";")) else: split_comments.append(comment_string) diff --git a/openpype/hosts/flame/plugins/publish/extract_subset_resources.py b/openpype/hosts/flame/plugins/publish/extract_subset_resources.py index d52669d955b..32f6b9508fc 100644 --- a/openpype/hosts/flame/plugins/publish/extract_subset_resources.py +++ b/openpype/hosts/flame/plugins/publish/extract_subset_resources.py @@ -5,7 +5,6 @@ import pyblish.api import openpype.api from openpype.hosts.flame import api as opfapi -from pprint import pformat class ExtractSubsetResources(openpype.api.Extractor): From fdb880c5440568e1f5f1a8fdc539ae7ddcad15f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Je=C5=BEek?= Date: Thu, 17 Mar 2022 12:57:34 +0100 Subject: [PATCH 12/12] Update openpype/hosts/flame/plugins/publish/collect_timeline_instances.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- .../hosts/flame/plugins/publish/collect_timeline_instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py index c6793874c0c..70340ad7a22 100644 --- a/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py +++ b/openpype/hosts/flame/plugins/publish/collect_timeline_instances.py @@ -188,7 +188,7 @@ def _get_xml_preset_attrs(self, attributes, split): # get pattern defined by type pattern = TXT_PATERN - if "number" in a_type or "float" in a_type: + if a_type in ("number" , "float"): pattern = NUM_PATERN res_goup = pattern.findall(value)