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

UI syntax sugar for node variadic T inputs as Vec<T> #2462

Open
Keavon opened this issue Mar 18, 2025 · 4 comments
Open

UI syntax sugar for node variadic T inputs as Vec<T> #2462

Keavon opened this issue Mar 18, 2025 · 4 comments

Comments

@Keavon
Copy link
Member

Keavon commented Mar 18, 2025

A node which takes a Vec should be able to expose itself as a variadic input, which looks like this:

100% Zoom 200% Zoom
Image Image

(7x14 rectangle with 2px rounding)

Multiple wires can enter this. The order of the wires entering the variadic input does matter, and it laid out from top to bottom. The node receives these as a Vec of T and otherwise acts normally.

The node macro can define whether a data type, that's a Vec, is shown as variadic or regular. We should also consider whether we support the Table data type, where multiple wires become multiple table rows.

@optozorax
Copy link

optozorax commented Mar 18, 2025

Since variables are currently have no names, they will only have order in this architecture.

What if I want to add new variable in the middle of the existing variables? Should I remove current last connections, add new connections, and then restore them again?

What if I have a lot of percentage values, how do I know that I connected it to the right position?

This will be much easier, if variables had names and all variables that you connect will just use name that it have.

upd: but what if I want to connect Math node to this, it has no name...

@Keavon Keavon changed the title UI and syntax sugar for node variadic T inputs as Vec<T> UI syntax sugar for node variadic T inputs as Vec<T> Mar 18, 2025
@Keavon
Copy link
Member Author

Keavon commented Mar 18, 2025

Each wire simply pushes into the Vec. The node itself just receives the Vec and does what it normally does, so nothing is changed. For the "Math" node in #2459, I think we'll likely just assign A, B, C, ..., Z, AA, AB, ..., etc.

@optozorax
Copy link

That's not ergonomic for a user :( if I have a lot of variables, then I will be confused very soon by these names

@Keavon
Copy link
Member Author

Keavon commented Mar 18, 2025

Let's discuss that in the issue for the Math node so we can explore some possibilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Short-Term
Development

No branches or pull requests

2 participants