From 82416b248217fb1ac3d0150988e0588f7667735b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 2 Apr 2024 13:50:04 +0200 Subject: [PATCH] check if all frames exist before IFD extraction --- .../houdini/plugins/publish/extract_mantra_ifd.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_ifd.py b/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_ifd.py index caaf0fd44b..917618360c 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_ifd.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/extract_mantra_ifd.py @@ -29,6 +29,18 @@ def process(self, instance): render_rop(ropnode) files = instance.data["frames"] + # Check if all frames exists. + # Frames can be nonexistent if user cancels the render. + missing_frames = [ + frame + for frame in instance.data["frames"] + if not os.path.exists( + os.path.normpath(os.path.join(staging_dir, frame))) + ] + if missing_frames: + raise RuntimeError("Failed to complete Mantra ifd extraction. " + "Missing output files: {}".format( + missing_frames)) if "representations" not in instance.data: instance.data["representations"] = []