From fa06d6003e2c82f54b8bcb2f08ac360b82fe3772 Mon Sep 17 00:00:00 2001 From: Cyprien CAILLOT Date: Thu, 19 Dec 2024 10:37:43 +0100 Subject: [PATCH 1/5] Bump version to 4.0.17 --- src/quadpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quadpype/version.py b/src/quadpype/version.py index b731ace556..0c7821ca45 100644 --- a/src/quadpype/version.py +++ b/src/quadpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """File declaring QuadPype version.""" -__version__ = "4.0.16" +__version__ = "4.0.17" From bde03e2409c9097d7a28cced6359a87d5445132f Mon Sep 17 00:00:00 2001 From: Cyprien CAILLOT Date: Thu, 19 Dec 2024 14:04:30 +0100 Subject: [PATCH 2/5] Fix extract_sequence.py --- .../plugins/publish/extract_sequence.py | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py b/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py index bc3fc5316f..056359723c 100644 --- a/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py +++ b/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py @@ -132,7 +132,7 @@ def process(self, instance): mark_out = export_frames_without_offset[-1] # Save to staging dir - output_dir = instance.data.get("stagingDir").replace("\\", "/") + output_dir = instance.data.get("stagingDir") if not output_dir: # Create temp folder if staging dir is not set output_dir = ( @@ -193,7 +193,6 @@ def process(self, instance): ) # Fill tags and new families from project settings - #instance_families = get_publish_instance_families(instance) tags = [] custom_tags = [] if "review" in instance.data["families"]: @@ -384,36 +383,34 @@ def render_review( output_filepaths_by_frame_index[frame_index] = filepath # Ensure the frame has been properly created - if os.path.exists(filepath): - continue - - if export_type == "camera" and frame_index == mark_out: - # There is a bug in TVPaint, it seems to NOT render the last frame in camera mode sometimes - - # TODO: We should recreate a clean george_script_lines with only info to render the last frame - # Replace the export filepath - last_frame_filename = filename_template.format(frame=mark_out) - george_script_lines = re.sub(origin_first_filename, last_frame_filename, george_script_lines) - - # set the mark in to mark_out - if "tv_markin" not in george_script_lines: - george_script_lines = "{}\n{}".format("tv_markin {}".format(mark_out), george_script_lines) - george_script_lines = "{}\n{}".format(george_script_lines, - "tv_markin {}".format(origin_mark_in)) - else: - george_script_lines = re.sub("tv_markin {}".format(mark_in), - "tv_markin {}".format(mark_out), - george_script_lines, count=1) - - george_script_lines = re.sub(tv_export, tv_export.replace(str(export_lenght), "0"), - george_script_lines) - - execute_george_through_file(george_script_lines) - - # If the frame has still not been generated, - # this is a true issue we need to crash and notify the user if not os.path.exists(filepath): - raise KnownPublishError("Output ('{}') was not rendered and exported to disk.".format(filepath)) + if export_type == "camera" and frame_index == mark_out: + # There is a bug in TVPaint, it seems to NOT render the last frame in camera mode sometimes + + # TODO: We should recreate a clean george_script_lines with only info to render the last frame + # Replace the export filepath + last_frame_filename = filename_template.format(frame=mark_out) + george_script_lines = re.sub(origin_first_filename, last_frame_filename, george_script_lines) + + # set the mark in to mark_out + if "tv_markin" not in george_script_lines: + george_script_lines = "{}\n{}".format("tv_markin {}".format(mark_out), george_script_lines) + george_script_lines = "{}\n{}".format(george_script_lines, + "tv_markin {}".format(origin_mark_in)) + else: + george_script_lines = re.sub("tv_markin {}".format(mark_in), + "tv_markin {}".format(mark_out), + george_script_lines, count=1) + + george_script_lines = re.sub(tv_export, tv_export.replace(str(export_lenght), "0"), + george_script_lines) + + execute_george_through_file(george_script_lines) + + # If the frame has still not been generated, + # this is a true issue we need to crash and notify the user + if not os.path.exists(filepath): + raise KnownPublishError("Output ('{}') was not rendered and exported to disk.".format(filepath)) thumbnail_filepath = None if output_filepaths_by_frame_index: @@ -494,7 +491,7 @@ def render( opacity_by_layer_id[layer_id] = self._convert_opacity_range(layer["opacity"]) - # filter the layers to compose to remove those who didn't have a render + # filter the layers to compose to remove those who didn't have a render filtered_layers = [layer for layer in layers if layer['layer_id'] in output_used_layers_id] # Prepare bg image if apply_background enabled From 925cce172d62e062584cc9cd07d818bf14e694e0 Mon Sep 17 00:00:00 2001 From: Cyprien CAILLOT Date: Thu, 19 Dec 2024 14:15:42 +0100 Subject: [PATCH 3/5] Fix extract_sequence.py --- .../plugins/publish/extract_sequence.py | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py b/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py index 056359723c..25118d6110 100644 --- a/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py +++ b/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py @@ -383,34 +383,36 @@ def render_review( output_filepaths_by_frame_index[frame_index] = filepath # Ensure the frame has been properly created + if os.path.exists(filepath): + continue + + if export_type == "camera" and frame_index == mark_out: + # There is a bug in TVPaint, it seems to NOT render the last frame in camera mode sometimes + + # TODO: We should recreate a clean george_script_lines with only info to render the last frame + # Replace the export filepath + last_frame_filename = filename_template.format(frame=mark_out) + george_script_lines = re.sub(origin_first_filename, last_frame_filename, george_script_lines) + + # set the mark in to mark_out + if "tv_markin" not in george_script_lines: + george_script_lines = "{}\n{}".format("tv_markin {}".format(mark_out), george_script_lines) + george_script_lines = "{}\n{}".format(george_script_lines, + "tv_markin {}".format(origin_mark_in)) + else: + george_script_lines = re.sub("tv_markin {}".format(mark_in), + "tv_markin {}".format(mark_out), + george_script_lines, count=1) + + george_script_lines = re.sub(tv_export, tv_export.replace(str(export_lenght), "0"), + george_script_lines) + + execute_george_through_file(george_script_lines) + + # If the frame has still not been generated, + # this is a true issue we need to crash and notify the user if not os.path.exists(filepath): - if export_type == "camera" and frame_index == mark_out: - # There is a bug in TVPaint, it seems to NOT render the last frame in camera mode sometimes - - # TODO: We should recreate a clean george_script_lines with only info to render the last frame - # Replace the export filepath - last_frame_filename = filename_template.format(frame=mark_out) - george_script_lines = re.sub(origin_first_filename, last_frame_filename, george_script_lines) - - # set the mark in to mark_out - if "tv_markin" not in george_script_lines: - george_script_lines = "{}\n{}".format("tv_markin {}".format(mark_out), george_script_lines) - george_script_lines = "{}\n{}".format(george_script_lines, - "tv_markin {}".format(origin_mark_in)) - else: - george_script_lines = re.sub("tv_markin {}".format(mark_in), - "tv_markin {}".format(mark_out), - george_script_lines, count=1) - - george_script_lines = re.sub(tv_export, tv_export.replace(str(export_lenght), "0"), - george_script_lines) - - execute_george_through_file(george_script_lines) - - # If the frame has still not been generated, - # this is a true issue we need to crash and notify the user - if not os.path.exists(filepath): - raise KnownPublishError("Output ('{}') was not rendered and exported to disk.".format(filepath)) + raise KnownPublishError("Output ('{}') was not rendered and exported to disk.".format(filepath)) thumbnail_filepath = None if output_filepaths_by_frame_index: From 814c206e329b6abe285bb075fa7c684d7b84cac8 Mon Sep 17 00:00:00 2001 From: Cyprien CAILLOT Date: Thu, 19 Dec 2024 14:16:46 +0100 Subject: [PATCH 4/5] Fix extract_sequence.py --- src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py b/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py index 25118d6110..fc714e08d8 100644 --- a/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py +++ b/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py @@ -193,6 +193,7 @@ def process(self, instance): ) # Fill tags and new families from project settings + #instance_families = get_publish_instance_families(instance) tags = [] custom_tags = [] if "review" in instance.data["families"]: @@ -493,7 +494,7 @@ def render( opacity_by_layer_id[layer_id] = self._convert_opacity_range(layer["opacity"]) - # filter the layers to compose to remove those who didn't have a render + # filter the layers to compose to remove those who didn't have a render filtered_layers = [layer for layer in layers if layer['layer_id'] in output_used_layers_id] # Prepare bg image if apply_background enabled From d920412f5ff9cffddf2c2066e4b2c0e91354912f Mon Sep 17 00:00:00 2001 From: Ben Souchet Date: Thu, 19 Dec 2024 15:19:59 +0100 Subject: [PATCH 5/5] Ensure path is correctly formatted --- src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py b/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py index fc714e08d8..4d1709be2b 100644 --- a/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py +++ b/src/quadpype/hosts/tvpaint/plugins/publish/extract_sequence.py @@ -139,6 +139,8 @@ def process(self, instance): tempfile.mkdtemp(prefix="tvpaint_render_") ).replace("\\", "/") instance.data["stagingDir"] = output_dir + else: + output_dir = output_dir.replace("\\", "/") self.log.debug( "Files will be rendered to folder: {}".format(output_dir)