From cd5303ef7b09014115f56432337a4b461617d2df Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 23 Sep 2024 14:42:01 +0200 Subject: [PATCH 1/4] Remove legacy code --- client/ayon_core/plugins/load/delivery.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/client/ayon_core/plugins/load/delivery.py b/client/ayon_core/plugins/load/delivery.py index c7954a18b2..60d4c01258 100644 --- a/client/ayon_core/plugins/load/delivery.py +++ b/client/ayon_core/plugins/load/delivery.py @@ -267,17 +267,11 @@ class DeliveryOptionsDialog(QtWidgets.QDialog): new_report_items, uploaded = deliver_single_file(*args) report_items.update(new_report_items) self._update_progress(uploaded) - else: # fallback for Pype2 and representations without files - frame = repre["context"].get("frame") - if frame: - repre["context"]["frame"] = len(str(frame)) * "#" - - if not frame: - new_report_items, uploaded = deliver_single_file(*args) - else: - new_report_items, uploaded = deliver_sequence(*args) - report_items.update(new_report_items) - self._update_progress(uploaded) + else: + raise ValueError( + "Representation entity is lacking `files`." + f" Unable to process entity: {repre}" + ) self.text_area.setText(self._format_report(report_items)) self.text_area.setVisible(True) From b85289080e4289810bdebbca9b87f490ddac19fa Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 23 Sep 2024 15:02:12 +0200 Subject: [PATCH 2/4] Remove unused import --- client/ayon_core/plugins/load/delivery.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/ayon_core/plugins/load/delivery.py b/client/ayon_core/plugins/load/delivery.py index 60d4c01258..09c396ff6f 100644 --- a/client/ayon_core/plugins/load/delivery.py +++ b/client/ayon_core/plugins/load/delivery.py @@ -17,8 +17,7 @@ from ayon_core.pipeline.load import get_representation_path_with_anatomy from ayon_core.pipeline.delivery import ( get_format_dict, check_destination_path, - deliver_single_file, - deliver_sequence, + deliver_single_file ) From ffd548201849c20436f147d109998e8cd1a98dbd Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 23 Sep 2024 15:17:47 +0200 Subject: [PATCH 3/4] Fix not removing absolute path in Maya DL submission This occured only in Maya (or DCC with AOV), caused pasting whole absolute path to metadata.json which could caused `Given file names contain full paths` (if ValidateExpectedFiles was disabled). 'files' is expecting only file names, not full path. --- client/ayon_core/pipeline/farm/pyblish_functions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/ayon_core/pipeline/farm/pyblish_functions.py b/client/ayon_core/pipeline/farm/pyblish_functions.py index b218dc78e5..af90903bd8 100644 --- a/client/ayon_core/pipeline/farm/pyblish_functions.py +++ b/client/ayon_core/pipeline/farm/pyblish_functions.py @@ -788,6 +788,11 @@ def _create_instances_for_aov(instance, skeleton, aov_filter, additional_data, colorspace = product.colorspace break + if isinstance(files, (list, tuple)): + files = [os.path.basename(f) for f in files] + else: + files = os.path.basename(files) + rep = { "name": ext, "ext": ext, From e9b67edc0f16f972c6d0d53f056ff69c03f49653 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 23 Sep 2024 15:37:58 +0200 Subject: [PATCH 4/4] Remove legacy condition completely --- client/ayon_core/plugins/load/delivery.py | 70 +++++++++++------------ 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/client/ayon_core/plugins/load/delivery.py b/client/ayon_core/plugins/load/delivery.py index 09c396ff6f..6a0947cc42 100644 --- a/client/ayon_core/plugins/load/delivery.py +++ b/client/ayon_core/plugins/load/delivery.py @@ -230,47 +230,41 @@ class DeliveryOptionsDialog(QtWidgets.QDialog): self.log ] - if repre.get("files"): - src_paths = [] - for repre_file in repre["files"]: - src_path = self.anatomy.fill_root(repre_file["path"]) - src_paths.append(src_path) - sources_and_frames = collect_frames(src_paths) + src_paths = [] + for repre_file in repre["files"]: + src_path = self.anatomy.fill_root(repre_file["path"]) + src_paths.append(src_path) + sources_and_frames = collect_frames(src_paths) - frames = set(sources_and_frames.values()) - frames.discard(None) - first_frame = None - if frames: - first_frame = min(frames) + frames = set(sources_and_frames.values()) + frames.discard(None) + first_frame = None + if frames: + first_frame = min(frames) - for src_path, frame in sources_and_frames.items(): - args[0] = src_path - # Renumber frames - if renumber_frame and frame is not None: - # Calculate offset between - # first frame and current frame - # - '0' for first frame - offset = frame_offset - int(first_frame) - # Add offset to new frame start - dst_frame = int(frame) + offset - if dst_frame < 0: - msg = "Renumber frame has a smaller number than original frame" # noqa - report_items[msg].append(src_path) - self.log.warning("{} <{}>".format( - msg, dst_frame)) - continue - frame = dst_frame + for src_path, frame in sources_and_frames.items(): + args[0] = src_path + # Renumber frames + if renumber_frame and frame is not None: + # Calculate offset between + # first frame and current frame + # - '0' for first frame + offset = frame_offset - int(first_frame) + # Add offset to new frame start + dst_frame = int(frame) + offset + if dst_frame < 0: + msg = "Renumber frame has a smaller number than original frame" # noqa + report_items[msg].append(src_path) + self.log.warning("{} <{}>".format( + msg, dst_frame)) + continue + frame = dst_frame - if frame is not None: - anatomy_data["frame"] = frame - new_report_items, uploaded = deliver_single_file(*args) - report_items.update(new_report_items) - self._update_progress(uploaded) - else: - raise ValueError( - "Representation entity is lacking `files`." - f" Unable to process entity: {repre}" - ) + if frame is not None: + anatomy_data["frame"] = frame + new_report_items, uploaded = deliver_single_file(*args) + report_items.update(new_report_items) + self._update_progress(uploaded) self.text_area.setText(self._format_report(report_items)) self.text_area.setVisible(True)