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

Bugfix/201 fix some typo and correct expected return types #202

Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -30,7 +30,7 @@ def process(self, instance):
"to detail attributes.",
detail=(
"See log for more info."
f"Incorrect Rop(s)\n\n - {invalid[0].pah()}"
f"Incorrect Rop(s)\n\n - {invalid[0].path()}"
)
)

Expand All @@ -45,7 +45,7 @@ def get_invalid(cls, instance):
"Ensure a valid SOP output path is set." % rop_node.path()
)

return [rop_node.path()]
return [rop_node]

pattern = rop_node.parm("prim_to_detail_pattern").eval().strip()
if not pattern:
Expand All @@ -70,7 +70,7 @@ def get_invalid(cls, instance):
"value set, but 'Build Hierarchy from Attribute'"
"is enabled."
)
return [rop_node.path()]
return [rop_node]

# Let's assume each attribute is explicitly named for now and has no
# wildcards for Primitive to Detail. This simplifies the check.
Expand Down Expand Up @@ -106,15 +106,15 @@ def get_invalid(cls, instance):
"Geometry Primitives are missing "
"path attribute: `%s`" % path_attr
)
return [output_node.path()]
return [output_node]

# Ensure at least a single string value is present
if not attrib.strings():
cls.log.info(
"Primitive path attribute has no "
"string values: %s" % path_attr
)
return [output_node.path()]
return [output_node]

paths = None
for attr in pattern.split(" "):
Expand Down Expand Up @@ -150,4 +150,4 @@ def get_invalid(cls, instance):
"Path has multiple values: %s (path: %s)"
% (list(values), path)
)
return [output_node.path()]
return [output_node]
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_invalid(cls, instance):
"Ensure a valid SOP output path is set." % node.path()
)

return [node.path()]
return [node]

if not hasattr(output_node, "geometry"):
# In the case someone has explicitly set an Object
Expand All @@ -63,4 +63,4 @@ def get_invalid(cls, instance):
invalid = True

if invalid:
return [instance]
return [output_node]
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def get_invalid(cls, instance):
# Check trange parm, 0 means Render Current Frame
frame_range = node.evalParm("trange")
if frame_range == 0:
return []
return

output_parm = lib.get_output_parameter(node)
unexpanded_str = output_parm.unexpandedString()

if "$F" not in unexpanded_str:
cls.log.error("No frame token found in '%s'" % node.path())
return [instance]
return [node]
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_invalid(cls, instance):
"Ensure a valid COP output path is set." % node.path()
)

return [node.path()]
return [node]

# Output node must be a Sop node.
if not isinstance(output_node, hou.CopNode):
Expand All @@ -57,7 +57,7 @@ def get_invalid(cls, instance):
"instead found category type: %s",
output_node.path(), output_node.type().category().name()
)
return [output_node.path()]
return [output_node]

# For the sake of completeness also assert the category type
# is Cop2 to avoid potential edge case scenarios even though
Expand All @@ -66,4 +66,4 @@ def get_invalid(cls, instance):
cls.log.error(
"Output node %s is not of category Cop2.", output_node.path()
)
return [output_node.path()]
return [output_node]
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
"""Validator for checking that export is a single frame."""
import hou

from ayon_core.pipeline import (
PublishValidationError,
OptionalPyblishPluginMixin
Expand Down Expand Up @@ -35,8 +37,6 @@ def process(self, instance):
@classmethod
def get_invalid(cls, instance):

invalid = []

frame_start = instance.data.get("frameStartHandle")
frame_end = instance.data.get("frameEndHandle")

Expand All @@ -48,12 +48,11 @@ def get_invalid(cls, instance):
return

if frame_start != frame_end:
invalid.append(instance.data["instance_node"])
rop = hou.node(instance.data["instance_node"])
cls.log.error(
"Invalid frame range on '%s'."
"You should use the same frame number for 'f1' "
"and 'f2' parameters.",
instance.data["instance_node"].path()
rop.path()
)

return invalid
return [rop]
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ def get_invalid(cls, instance):
title=cls.label)

if output_extension != extension:
return [node.path()]
return [node]
4 changes: 2 additions & 2 deletions client/ayon_houdini/plugins/publish/validate_frame_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def get_invalid(cls, instance):
# Check trange parm, 0 means Render Current Frame
frame_range = node.evalParm("trange")
if frame_range == 0:
return []
return

output_parm = lib.get_output_parameter(node)
unexpanded_str = output_parm.unexpandedString()

if "$F" not in unexpanded_str:
cls.log.error("No frame token found in '%s'" % node.path())
return [instance]
return [node]
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ def get_invalid(cls, instance):
for node in instance[:]:
if node.parm("mkpath").eval() != 1:
cls.log.error("Invalid settings found on `%s`" % node.path())
result.append(node.path())
result.append(node)
BigRoy marked this conversation as resolved.
Show resolved Hide resolved

return result
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_invalid(cls, context) -> "List[hou.Node]":
# Get instances matching this plugin families
instances = pyblish.api.instances_by_plugin(list(context), cls)
if not instances:
return []
return
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved

# Get expected rendered filepaths
paths_to_instance_id = defaultdict(list)
Expand All @@ -119,7 +119,7 @@ def get_invalid(cls, context) -> "List[hou.Node]":
invalid_paths.append(path)

if not invalid_instance_ids:
return []
return

# Log invalid sequences as single collection
collections, remainder = clique.assemble(invalid_paths)
Expand Down
6 changes: 1 addition & 5 deletions client/ayon_houdini/plugins/publish/validate_subset_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ def process(self, instance):
@classmethod
def get_invalid(cls, instance):

invalid = []

rop_node = hou.node(instance.data["instance_node"])

# Check product name
Expand All @@ -76,13 +74,11 @@ def get_invalid(cls, instance):
)

if instance.data.get("productName") != product_name:
invalid.append(rop_node)
cls.log.error(
"Invalid product name on rop node '%s' should be '%s'.",
rop_node.path(), product_name
)

return invalid
return [rop_node]

@classmethod
def repair(cls, instance):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_invalid(cls, instance):
"Ensure a valid LOP path is set." % node.path()
)

return [node.path()]
return [node]

# Output node must be a Sop node.
if not isinstance(output_node, hou.LopNode):
Expand All @@ -61,7 +61,7 @@ def get_invalid(cls, instance):
"instead found category type: %s"
% (output_node.path(), output_node.type().category().name())
)
return [output_node.path()]
return [output_node]

def get_description(self):
return inspect.cleandoc(
Expand Down
Loading