Nodes: Draw node buttons between outputs and inputs for custom layouts #112228

Merged
Lukas Tönne merged 3 commits from LukasTonne/blender:node-options-before-inputs into main 2023-09-11 14:40:41 +02:00

3 Commits

Author SHA1 Message Date
Lukas Tönne 754d2a3d4e Also draw buttons before the first panel to avoid drawing inside panels. 2023-09-11 14:35:43 +02:00
Lukas Tönne b96b0f2c0b Removed unused assignment. 2023-09-11 14:26:25 +02:00
Lukas Tönne 5fc1050fd4 Draw node buttons between outputs and inputs for custom layouts.
Node buttons/options are conventionally drawn between outputs and
inputs. With custom node layouts this is not so clear any more since
inputs and outputs can be mixed.

This patch simply draws buttons right before the first input, or at the
bottom if a node does not have input sockets. This ensures a layout
compatible with standard node drawing and does not require extra work.

Eventually an explicit declaration method could place buttons explicitly
but for now this yields a useful default behavior.
2023-09-11 14:21:04 +02:00