From 5bd6349430dff213c2323213efd5566827bb01e0 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 28 Aug 2024 22:05:45 +0200 Subject: [PATCH 1/2] Provide clearer error if no LOP path is set on USD render ROP --- .../plugins/publish/collect_local_render_instances.py | 11 +++++++++-- .../plugins/publish/collect_render_colorspace.py | 6 +++++- .../plugins/publish/validate_render_products.py | 8 +++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/client/ayon_houdini/plugins/publish/collect_local_render_instances.py b/client/ayon_houdini/plugins/publish/collect_local_render_instances.py index 35c0e5afff..ac80e98a71 100644 --- a/client/ayon_houdini/plugins/publish/collect_local_render_instances.py +++ b/client/ayon_houdini/plugins/publish/collect_local_render_instances.py @@ -63,9 +63,16 @@ def process(self, instance): "Skipping local render collecting.") return + if not instance.data.get("expectedFiles"): + self.log.warning( + "Missing collected expected files. " + "This may be due to misconfiguration of the ROP node, " + "like pointing to an invalid LOP or SOP path") + return + # Create Instance for each AOV. context = instance.context - expectedFiles = next(iter(instance.data["expectedFiles"]), {}) + expected_files = next(iter(instance.data["expectedFiles"]), {}) product_type = "render" # is always render product_group = get_product_name( @@ -85,7 +92,7 @@ def process(self, instance): # majority of production scenarios these would not be overridden. # TODO: Support renderer-specific explicit colorspace overrides colorspace = get_scene_linear_colorspace() - for aov_name, aov_filepaths in expectedFiles.items(): + for aov_name, aov_filepaths in expected_files.items(): product_name = product_group if aov_name: diff --git a/client/ayon_houdini/plugins/publish/collect_render_colorspace.py b/client/ayon_houdini/plugins/publish/collect_render_colorspace.py index 1166243ce3..cee60d4740 100644 --- a/client/ayon_houdini/plugins/publish/collect_render_colorspace.py +++ b/client/ayon_houdini/plugins/publish/collect_render_colorspace.py @@ -26,7 +26,11 @@ def process(self, instance): # Define render products for `create_instances_for_aov` # which uses it in `_create_instances_for_aov()` to match the render # product's name to aovs to define the colorspace. - expected_files = instance.data["expectedFiles"] + expected_files = instance.data.get("expectedFiles") + if not expected_files: + self.log.debug("No expected files found. " + "Skipping collecting of render colorspace.") + return aov_name = list(expected_files[0].keys()) render_products_data = colorspace.ARenderProduct(aov_name) instance.data["renderProducts"] = render_products_data diff --git a/client/ayon_houdini/plugins/publish/validate_render_products.py b/client/ayon_houdini/plugins/publish/validate_render_products.py index 774d517bfb..c6edc2ef3a 100644 --- a/client/ayon_houdini/plugins/publish/validate_render_products.py +++ b/client/ayon_houdini/plugins/publish/validate_render_products.py @@ -36,12 +36,14 @@ def get_description(self): def process(self, instance): + node_path = instance.data["instance_node"] if not instance.data.get("output_node"): - self.log.warning("No valid LOP node to render found.") - return + raise PublishValidationError( + f"No valid LOP path configured on ROP " + f"'{node_path}'.", + title="Invalid LOP path") if not instance.data.get("files", []): - node_path = instance.data["instance_node"] node = hou.node(node_path) rendersettings_path = ( node.evalParm("rendersettings") or "/Render/rendersettings" From ca1690a77c16194efe5f970d188bce2312a260eb Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 28 Aug 2024 22:09:07 +0200 Subject: [PATCH 2/2] Provide some details about the configured LOP path --- .../plugins/publish/validate_render_products.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/ayon_houdini/plugins/publish/validate_render_products.py b/client/ayon_houdini/plugins/publish/validate_render_products.py index c6edc2ef3a..609a663e6d 100644 --- a/client/ayon_houdini/plugins/publish/validate_render_products.py +++ b/client/ayon_houdini/plugins/publish/validate_render_products.py @@ -38,6 +38,14 @@ def process(self, instance): node_path = instance.data["instance_node"] if not instance.data.get("output_node"): + + # Report LOP path parm for better logs + lop_path_parm = hou.node(node_path).parm("loppath") + if lop_path_parm: + value = lop_path_parm.evalAsString() + self.log.warning( + f"ROP node 'loppath' parm is set to: '{value}'") + raise PublishValidationError( f"No valid LOP path configured on ROP " f"'{node_path}'.",