From 62a5e8ecdd771bf06ca46a2680da227154d3b4a6 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Thu, 13 Aug 2020 12:47:16 +0200 Subject: [PATCH 1/2] tweak default layer collection list --- .../standalonepublisher/publish/extract_bg_for_compositing.py | 2 +- .../standalonepublisher/publish/extract_bg_main_groups.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pype/plugins/standalonepublisher/publish/extract_bg_for_compositing.py b/pype/plugins/standalonepublisher/publish/extract_bg_for_compositing.py index d4d625097a..064c226ff7 100644 --- a/pype/plugins/standalonepublisher/publish/extract_bg_for_compositing.py +++ b/pype/plugins/standalonepublisher/publish/extract_bg_for_compositing.py @@ -16,7 +16,7 @@ class ExtractBGForComp(pype.api.Extractor): # Presetable allowed_group_names = [ - "OL", "BG", "MG", "FG", "UL", "SKY", "Field Guide", "Field_Guide", + "OL", "BG", "MG", "FG", "SB", "UL", "SKY", "Field Guide", "Field_Guide", "ANIM" ] diff --git a/pype/plugins/standalonepublisher/publish/extract_bg_main_groups.py b/pype/plugins/standalonepublisher/publish/extract_bg_main_groups.py index 58704c41d2..42530aeb14 100644 --- a/pype/plugins/standalonepublisher/publish/extract_bg_main_groups.py +++ b/pype/plugins/standalonepublisher/publish/extract_bg_main_groups.py @@ -9,7 +9,7 @@ PSDImage = None class ExtractBGMainGroups(pype.api.Extractor): - label = "Extract Background Main Groups" + label = "Extract Background Layout" order = pyblish.api.ExtractorOrder + 0.02 families = ["backgroundLayout"] hosts = ["standalonepublisher"] @@ -18,7 +18,7 @@ class ExtractBGMainGroups(pype.api.Extractor): # Presetable allowed_group_names = [ - "OL", "BG", "MG", "FG", "UL", "SKY", "Field Guide", "Field_Guide", + "OL", "BG", "MG", "FG", "UL", "SB", "SKY", "Field Guide", "Field_Guide", "ANIM" ] From df491a9145b3262c748a03a796262ca5cb5ad375 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 13 Aug 2020 12:52:48 +0200 Subject: [PATCH 2/2] skip collection if not ext in image extenstion --- .../widgets/widget_drop_frame.py | 114 ++++++++++-------- 1 file changed, 63 insertions(+), 51 deletions(-) diff --git a/pype/modules/standalonepublish/widgets/widget_drop_frame.py b/pype/modules/standalonepublish/widgets/widget_drop_frame.py index bbe8a0bff5..37d22cf887 100644 --- a/pype/modules/standalonepublish/widgets/widget_drop_frame.py +++ b/pype/modules/standalonepublish/widgets/widget_drop_frame.py @@ -173,10 +173,21 @@ class DropDataFrame(QtWidgets.QFrame): def _process_paths(self, in_paths): self.parent_widget.working_start() paths = self._get_all_paths(in_paths) - collections, remainders = clique.assemble(paths) + collectionable_paths = [] + non_collectionable_paths = [] + for path in in_paths: + ext = os.path.splitext(path)[1] + if ext in self.image_extensions: + collectionable_paths.append(path) + else: + non_collectionable_paths.append(path) + + collections, remainders = clique.assemble(collectionable_paths) + non_collectionable_paths.extend(remainders) for collection in collections: self._process_collection(collection) - for remainder in remainders: + + for remainder in non_collectionable_paths: self._process_remainder(remainder) self.parent_widget.working_stop() @@ -341,61 +352,62 @@ class DropDataFrame(QtWidgets.QFrame): actions = [] found = False - for item in self.components_list.widgets(): - if data['ext'] != item.in_data['ext']: - continue - if data['folder_path'] != item.in_data['folder_path']: - continue - - ex_is_seq = item.in_data['is_sequence'] - - # If both are single files - if not new_is_seq and not ex_is_seq: - if data['name'] == item.in_data['name']: - found = True - break - paths = list(data['files']) - paths.extend(item.in_data['files']) - c, r = clique.assemble(paths) - if len(c) == 0: + if data["ext"] in self.image_extensions: + for item in self.components_list.widgets(): + if data['ext'] != item.in_data['ext']: continue - a_name = 'merge' - item.add_action(a_name) - if a_name not in actions: - actions.append(a_name) - - # If new is sequence and ex is single file - elif new_is_seq and not ex_is_seq: - if data['name'] not in item.in_data['name']: + if data['folder_path'] != item.in_data['folder_path']: continue - ex_file = item.in_data['files'][0] - a_name = 'merge' - item.add_action(a_name) - if a_name not in actions: - actions.append(a_name) - continue + ex_is_seq = item.in_data['is_sequence'] - # If new is single file existing is sequence - elif not new_is_seq and ex_is_seq: - if item.in_data['name'] not in data['name']: + # If both are single files + if not new_is_seq and not ex_is_seq: + if data['name'] == item.in_data['name']: + found = True + break + paths = list(data['files']) + paths.extend(item.in_data['files']) + c, r = clique.assemble(paths) + if len(c) == 0: + continue + a_name = 'merge' + item.add_action(a_name) + if a_name not in actions: + actions.append(a_name) + + # If new is sequence and ex is single file + elif new_is_seq and not ex_is_seq: + if data['name'] not in item.in_data['name']: + continue + ex_file = item.in_data['files'][0] + + a_name = 'merge' + item.add_action(a_name) + if a_name not in actions: + actions.append(a_name) continue - a_name = 'merge' - item.add_action(a_name) - if a_name not in actions: - actions.append(a_name) - # If both are sequence - else: - if data['name'] != item.in_data['name']: - continue - if data['files'] == list(item.in_data['files']): - found = True - break - a_name = 'merge' - item.add_action(a_name) - if a_name not in actions: - actions.append(a_name) + # If new is single file existing is sequence + elif not new_is_seq and ex_is_seq: + if item.in_data['name'] not in data['name']: + continue + a_name = 'merge' + item.add_action(a_name) + if a_name not in actions: + actions.append(a_name) + + # If both are sequence + else: + if data['name'] != item.in_data['name']: + continue + if data['files'] == list(item.in_data['files']): + found = True + break + a_name = 'merge' + item.add_action(a_name) + if a_name not in actions: + actions.append(a_name) if new_is_seq: actions.append('split')