DescriptionThe display of node elements in the Node Editor is currently hardcoded. Beginning from the top, first all output sockets are rendered, then the preview rect, then the button rect, and finally all input sockets.
The current patch adds an integer "row" property to NodeSocket, that allows custom socket ordering.
Starting at the lowest encountered row index, all inputs and then all outputs with that row index are rendered. If row==0 (default row value), the preview rect and the button rect are rendered in between, maintaining current behavior.
Row range is currently clamped from -127 to 127, but this is essentially arbitrary (the row is stored as a short). However, extreme values should be disallowed, due to the "for(row=min;row<max;row++)" loop becoming inefficient for extreme ranges.
Repetitive code sections have been put into separate functions declared "inline", for efficiency and to indicate that they are for internal use within the file.
Patch Set 1 #
MessagesTotal messages: 1
|