From 605d43296d8d1c932dad3ad9e15bd3d7ea39337a Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 17 Feb 2022 17:39:43 +0100 Subject: [PATCH] OP-2669 - better selection of work folder Because work folder in Harmony is local, it must be replaced with folder where workfile will be finally published. In some cases naming convention of expected files didn't match correct value, which resulted in not updating the path. This explicitly replaces dir name of expected file with staging folder where renders will be created on a DL machine. --- .../plugins/publish/submit_harmony_deadline.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openpype/modules/default_modules/deadline/plugins/publish/submit_harmony_deadline.py b/openpype/modules/default_modules/deadline/plugins/publish/submit_harmony_deadline.py index bd375dbd6a..c677b72b2f 100644 --- a/openpype/modules/default_modules/deadline/plugins/publish/submit_harmony_deadline.py +++ b/openpype/modules/default_modules/deadline/plugins/publish/submit_harmony_deadline.py @@ -320,7 +320,8 @@ class HarmonySubmitDeadline( / published_scene.stem / f"{published_scene.stem}.xstage" ) - + self.log.info("published_scene:: {}".format(published_scene)) + self.log.info("xstage_path:: {}".format(xstage_path)) unzip_dir = (published_scene.parent / published_scene.stem) with _ZipFile(published_scene, "r") as zip_ref: zip_ref.extractall(unzip_dir.as_posix()) @@ -351,12 +352,12 @@ class HarmonySubmitDeadline( # use that one. if not ideal_scene: xstage_path = xstage_files[0] - + self.log.info("xstage_path:: {}".format(xstage_path)) return xstage_path def get_plugin_info(self): work_scene = Path(self._instance.data["source"]) - + self.log.info("work scene:: {}".format(work_scene)) # this is path to published scene workfile _ZIP_. Before # rendering, we need to unzip it. published_scene = Path( @@ -368,14 +369,13 @@ class HarmonySubmitDeadline( # for submit_publish job to create .json file in self._instance.data["outputDir"] = render_path new_expected_files = [] - work_path_str = str(work_scene.parent.as_posix()) render_path_str = str(render_path.as_posix()) for file in self._instance.data["expectedFiles"]: _file = str(Path(file).as_posix()) + expected_dir_str = os.path.dirname(_file) new_expected_files.append( - _file.replace(work_path_str, render_path_str) + _file.replace(expected_dir_str, render_path_str) ) - audio_file = self._instance.data.get("audioFile") if audio_file: abs_path = xstage_path.parent / audio_file