Details
Diff Detail
- Repository
- rB Blender
- Branch
- master
- Build Status
Buildable 5938 Build 5938: arc lint + arc unit
Event Timeline
This adds label support to sockets much like nodes. This is a proof of concept to see if this approach is acceptable as changing socket name is complicated and hints at future nodes refactor.
This patch works by providing a new socket->label member.
This is only used when drawing the node and if it's not set then it falls back to the socket->name.
While this works well in theory, in practice it becomes an annoyance, this is currently the case with dynamic socket names for the new Voronoi procedural texture.
When playing around or experimenting with settings every time the socket name changes between different settings nodes are disconnected, and one must manually reconnect them again every time.
I'm not against it in principle, clearer socket names are definitely desirable, but not at the expense of keeping connections. Is there a way for socket names to change while still trying to keep current connections live?
@Duarte Farrajota Ramos (duarteframos) this doesn’t disconnect the sockets so the name changes are not disruptive
Additional labels to consider:
Power - "Exponent"
Logarithm - "Base"
Less Than / Greater Than - "Threshold"
Snap - "Increment"
Pingpong - "Scale"
| source/blender/editors/space_node/node_draw.c | ||
|---|---|---|
| 417 | Don't put complicated code like this in macros, assign it to a variable first. Add a const char *nodeSocketLabel(const bNodeSocket *); utility function Also would use (nsock->label[0] != '\0) ? nsock->name : nsock->label`, no need to compare strings here. | |
| source/blender/makesdna/DNA_node_types.h | ||
| 119 | It's not really user-defined like node labels, more like a dynamic label. | |
| source/blender/nodes/intern/node_util.c | ||
| 124–132 | I'm not sure about these names, I would rather keep just Value. | |
| 140–141 | Maybe could be Multiplier and Addend instead, I don't much like the use of B and C here. | |
| 145 | Name it just Threshold. | |
Address comments, thanks.
Add support for drawing node panel via py and rna (readonly).
Add support for node group sockets.
Seems fine now, with minor comment that you can address without review.
| source/blender/editors/space_node/node_draw.c | ||
|---|---|---|
| 358 | Name this nodeSocketLabel() and put it in node.c, to match nodeLabel(). | |
