From 64445d8d21e8209e8894027664cc4770c19cc0aa Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 7 Jan 2022 17:32:18 +0100 Subject: [PATCH] flame: creator debuging --- openpype/hosts/flame/api/pipeline.py | 12 +++++++++--- openpype/hosts/flame/api/plugin.py | 16 +++++++++++----- .../flame/plugins/create/create_shot_clip.py | 1 + 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/flame/api/pipeline.py b/openpype/hosts/flame/api/pipeline.py index 9be59990d2..b65c85f5df 100644 --- a/openpype/hosts/flame/api/pipeline.py +++ b/openpype/hosts/flame/api/pipeline.py @@ -10,7 +10,8 @@ from .lib import ( set_segment_data_marker, set_publish_attribute, maintained_segment_selection, - get_current_sequence + get_current_sequence, + reset_segment_selection ) from .. import HOST_DIR @@ -158,8 +159,13 @@ def maintained_selection(): # check if segment is selected if isinstance(CTX.selection[0], flame.PySegment): sequence = get_current_sequence(CTX.selection) + try: - with maintained_segment_selection(sequence): + with maintained_segment_selection(sequence) as selected: yield finally: - pass + # reset all selected clips + reset_segment_selection(sequence) + # select only original selection of segments + for segment in selected: + segment.selected = True diff --git a/openpype/hosts/flame/api/plugin.py b/openpype/hosts/flame/api/plugin.py index 30a4f3dfc4..f2e67749f2 100644 --- a/openpype/hosts/flame/api/plugin.py +++ b/openpype/hosts/flame/api/plugin.py @@ -89,7 +89,8 @@ class CreatorWidget(QtWidgets.QDialog): self.setStyleSheet(style.load_stylesheet()) def _on_ok_clicked(self): - self.result = self.value(self.items) + log.debug("ok is clicked: {}".format(self.items)) + self.result = self._values(self.items) self.close() def _on_cancel_clicked(self): @@ -100,7 +101,7 @@ class CreatorWidget(QtWidgets.QDialog): self.result = None event.accept() - def value(self, data, new_data=None): + def _values(self, data, new_data=None): new_data = new_data or dict() for k, v in data.items(): new_data[k] = { @@ -109,10 +110,10 @@ class CreatorWidget(QtWidgets.QDialog): } if v["type"] == "dict": new_data[k]["target"] = v["target"] - new_data[k]["value"] = self.value(v["value"]) + new_data[k]["value"] = self._values(v["value"]) if v["type"] == "section": new_data.pop(k) - new_data = self.value(v["value"], new_data) + new_data = self._values(v["value"], new_data) elif getattr(v["value"], "currentText", None): new_data[k]["target"] = v["target"] new_data[k]["value"] = v["value"].currentText() @@ -343,6 +344,8 @@ class PublishableClip: def __init__(self, segment, **kwargs): self.rename_index = kwargs["rename_index"] + self.log = kwargs["log"] + # get main parent objects self.current_segment = segment sequence_name = flib.get_current_sequence([segment]).name.get_value() @@ -369,6 +372,9 @@ class PublishableClip: # adding ui inputs if any self.ui_inputs = kwargs.get("ui_inputs", {}) + self.log.info("Inside of plugin: {}".format( + self.marker_data + )) # populate default data before we get other attributes self._populate_segment_default_data() @@ -430,7 +436,7 @@ class PublishableClip: # define ui inputs if non gui mode was used self.shot_num = self.cs_index - log.debug( + self.log.debug( "____ self.shot_num: {}".format(self.shot_num)) # ui_inputs data or default values if gui was not used diff --git a/openpype/hosts/flame/plugins/create/create_shot_clip.py b/openpype/hosts/flame/plugins/create/create_shot_clip.py index 866b5108fa..123a1c1575 100644 --- a/openpype/hosts/flame/plugins/create/create_shot_clip.py +++ b/openpype/hosts/flame/plugins/create/create_shot_clip.py @@ -61,6 +61,7 @@ class CreateShotClip(opfapi.Creator): sorted_selected_segments.extend(unsorted_selected_segments) kwargs = { + "log": self.log, "ui_inputs": widget.result, "avalon": self.data }