Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide clearer error if no LOP path is set on USD render ROP #82

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions client/ayon_houdini/plugins/publish/validate_render_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,22 @@ 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

# 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}'.",
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"
Expand Down