This patch adds multi-input support to the Attribute Remove Node. For this to work it also adds
and modifies a few underlying methods.
Details
- Reviewers
Hans Goudey (HooglyBoogly) - Maniphest Tasks
- T86457: Add "Attribute Remove" node
- Commits
- rB070010e203f6: Nodes: multi-input support for Attribute Remove node
Diff Detail
- Repository
- rB Blender
Event Timeline
| source/blender/modifiers/intern/MOD_nodes.cc | ||
|---|---|---|
| 307–311 | @Jacques Lucke (JacquesLucke) You had concerns about this change before but for other sockets then geometry it seems nice to get the default value from the input field if no socket is connected. | |
In the context of this change we should also look at the decision not to output attribute names from most nodes, because that could be confusing.
Having a multi-input for attribute names encourages passing attribute names around, which is not a bad thing, but needs to be an explicit decision.
Also note that the String Inputs node don't show the attribute search currently.
| source/blender/modifiers/intern/MOD_nodes.cc | ||
|---|---|---|
| 307–311 | It's more fine for input sockets that have a value. Is there a way to say that such a multi-input has no inputs (i.e. the vector is empty)? It's not really needed for this specific socket, but might be useful for others maybe? | |
| source/blender/nodes/geometry/nodes/node_geo_attribute_remove.cc | ||
| 46 | This check is not necessary. | |
| 52 | This should probably be continue. | |
Didn't test yet, but I really like this idea!
| source/blender/nodes/geometry/nodes/node_geo_attribute_remove.cc | ||
|---|---|---|
| 45–48 | You wouldn't need to add a new get_multi_input function if you used extract_input in geo_node_attribute_remove_exec and passed a span into this function. | |
This looks good to me, and it works well. Maybe Jacques should check the change in NOD_geometry_exec.hh though (which we worked out in chat).
Don't forget clang format though.
| source/blender/nodes/NOD_geometry_exec.hh | ||
|---|---|---|
| 132–133 | Moving from a const value doesn't really make sense usually. | |
| source/blender/nodes/NOD_geometry_exec.hh | ||
|---|---|---|
| 132–133 | Agh, turns out the first part wasn't necessary, it's just adding the second template parameter that does it. values.append(input_values_.extract<T, StringRef>(sub_identifier)); | |