Dynamic Input Sockets for Math Operations
The idea here is simply to add Dynamic input Sockets for the Math and Vector Math node. Or maybe add a new node explicity for the math operations that are relevant to dynamic input sockets.
I'm not sure all operations should have a dynamic input socket logic, but I know for sure that the add operation could benefit from this.
I know this is a sensitive topic and a similar idea probably have been posted here before. But after a recent project, in which I had to add a lot of float values together, I wondered why such a feature is not here yet, while it's already available in a lot of other similar applications.
If there is a known limitation or a plan to go beyond simple dynamic input sockets, I'd love to be aware ! Feel free to comment.
My first idea is simply to allow the existing Math node to have dynamic inputs. The input order is the order of the operation.
The second idea is to have an input similar to the "Join" nodes, and have specific nodes such as "Sum" that returns the sum of all the float inputs for example. The order of the values plugged counts (In a sum it's not very important) Don't mind the warnings and wrong data colors, this is only to show the input.
My last idea is something that might fit better in the grand scheme or future plans for Blender, but is overly complicated for a simple task (even tho it allows for much more complex)
This idea relies on the fact that Bundles have dynamic input sockets for any type of Data, meaning we could plug as many float, integers, vectors etc.. as we want. The using a repeat zone, and a get bundle item node, we could technically return the sum dynamically.
This have downsides tho :
-
We don't have a node that let us know how many items are stores in the bundle, meaning we can't "automatically" adapt the repeat count to the bundle items count. This is why I was thinking of a new node, similar to "Domain Size" but for Bundles.
-
The Get Bundle Item only allows us to get the item from a Path, a string input. Meaning the name of our inputs in the Bundle are very important, and a single mistake in the name could lead to a failed attempt at finding the sum.
I believe it could be interesting to add the possibility to return an item from an Index, like the index switch. However using this method would only allow for finding the items of the first bundle layer (if there are nested bundle, we can't directly find the items burried deep in them)
11 Comments
what we need is a text formula node.
of course the text would be freely editable, can understand every python math features and the number of inputs is also freely adjustable. That would be a game changer.
You're right, some sort of VEX in geometry nodes would indeed be a game changer.
This is not to be mixed with dynamic input sockets for math operations tho haha since both features could benefit the users.
There's this WIP PR of a
Expressionnode by Jacques describing exactly your text:projects.blender.org/blender/blender/pulls/149091
God that would be so incredible to have this!!
What if every input socket has a dropdown list to select the actual Operation.
I thought of that but it would be very confusing, the order of operation would be hard to visualize. I think it's better to keep it fairly simple and only accumulate a single operation per node
having it in one node, somehow, would help create complex formulas.
but at this point it'd be better to have a math formula node in which you can just type in your formula. It is actually already possible with the "Node Booster" addon which is free and developped by bd3d.
I personnaly have no problem with doing formulas using multiple math nodes, it is in my opinion easier to read than a single node with multiple inputs and a different operations between the inputs, for the reason I mentionned before : It's harder to read the order of operation this way, there also wouldn't be a great support for parentheses.
I understand your idea but I think it's quite different from my original post idea (which is just some batch operations to find the sum of many values)
See also: blender.community/c/rightclickselect/vj3g/ blender.community/c/rightclickselect/Xr9o/ blender.community/c/rightclickselect/R5vz/
Since this is a very asked feature and have been asked for 3 years, I'm genuinely wondering why this hasn't been implemented yet. If this is a design issue or something else
This will probably take another 5 years or more to be added, but unfortunately this is one of the disadvantages of this type of development in open source projects, they take up PRs almost randomly, instead of adding fundamental features that should be there from very early on.
A list of some of the sorely needed features in Geometry Nodes (in my opinion of course):
Expression math node (they started a PR for this almost a year ago and seems to have abandoned it).
Portals, also looks like a forgotten feature after being discussed 2 years ago..
Geometry nodes spreadsheet doesn't have sorting to this day after 5 years ?? It is mind boggling to me that this was not in the first implementation, this is BASIC stuff..
Attribute visualization features e.g. visualizing vector attributes with actual vector lines instead of just hard to decipher numbers..
Most complex node graphs are unreadable messes because of these basic missing features.. try to go into the node graph for the built in array modifier if you want an example..
I could go on.. but this is very frustrating and I would LOVE to abandon houdini and use blender (which has superior UI in my opinion) but they just seem to have their priorities in different places than mine..