Skip to content
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
16 changes: 14 additions & 2 deletions tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def new_input_types(*args, **kwargs):
# Reflection is used to determine what the function signature is, so we can't just change the function signature
raise NotImplementedError("VariantSupport does not support VALIDATE_INPUTS yet")
else:
def validate_inputs(input_types):
inputs = cls.INPUT_TYPES()
def validate_individual(input_types, inputs):
for key, value in input_types.items():
if isinstance(value, SmartType):
continue
Expand All @@ -47,6 +46,19 @@ def validate_inputs(input_types):
if expected_type is not None and MakeSmartType(value) != expected_type:
return f"Invalid type of {key}: {value} (expected {expected_type})"
return True
def validate_inputs(input_types):
inputs = cls.INPUT_TYPES()

if not isinstance(input_types, list):
return validate_individual(input_types, inputs)

for input_type in input_types:
response = validate_individual(input_type, inputs)
if isinstance(response, str):
return response

return True

setattr(cls, "VALIDATE_INPUTS", validate_inputs)
return cls
return decorator
Expand Down
2 changes: 1 addition & 1 deletion utility_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def INPUT_TYPES(cls):
}

RETURN_TYPES = ("ACCUMULATION",)
INPUT_IS_LIST = (True,)
INPUT_IS_LIST = True

FUNCTION = "list_to_accumulation"

Expand Down