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

fix ListToAccumulationNode #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 12 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,17 @@ 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 isinstance(input_types, list):
for input_type in input_types:
responce = validate_individual(input_type, inputs)
if isinstance(responce, str):
return responce
return True
else:
return validate_individual(input_types, inputs)

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