Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10415)

Issue 14433064: Extended UILayout for node drawing

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by lukas.toenne1
Modified:
10 years, 6 months ago
Reviewers:
b.mont29, bf-codereview, brechtvl
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

This patch extends the draw_buttons function of nodes to integrate sockets into the general layout system and allow more flexible placement. Examples: Custom layout (using quick pynodes prototyping): http://www.pasteall.org/pic/60728 Avoiding "staircase" nodes by putting equivalent input/output on same row: http://www.pasteall.org/pic/show.php?id=60729 UINodeLayout is a slightly extended variant of the usual UILayout type. It has an additional function "node_socket", which creates a (column) sublayout and draws an input/output socket connector on the node in the vertical middle of the layout. Using the new layout is optional: any socket that is not handled in draw_buttons is drawn as before in the standard outputs/preview/buttons/inputs order (from top to bottom). Later this layout system could be used for more advanced features, like: * Vertical node layouts, placing sockets on the top/bottom node border. * Automatic disabling of sockets which are not drawn, removing the need for extra update functions. The uiLayout struct is currently internal to interface_layout.c. In order to access the node pointer in the layout context and allow sockets to retrieve placement info it is necessary to make these accessible in interface_node_layout.c. The layout C structs have therefore been moved into their own header file, intended only for layout implementation. To read the geometry of a layout after resolving but before freeing block layouts, the uiBlockLayoutResolve function now has 2 parts (only for internal layout use). Original git branch: https://www.gitorious.org/blender-trunk/blender-trunk/source/ba27b357bdb0f442d042b841f56cb7e8dec26a73:

Patch Set 1 #

Patch Set 2 : Moved node_layout.c into interface folder to avoid bad level includes #

Patch Set 3 : Avoid bad-level node_intern.h include by moving stuff into the ED_node.h #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+656 lines, -413 lines) Patch
source/blender/blenkernel/BKE_node.h View 1 chunk +1 line, -1 line 0 comments Download
source/blender/editors/include/ED_node.h View 1 2 4 chunks +13 lines, -1 line 1 comment Download
source/blender/editors/include/UI_interface.h View 1 1 chunk +10 lines, -0 lines 0 comments Download
source/blender/editors/interface/CMakeLists.txt View 1 2 chunks +2 lines, -0 lines 0 comments Download
source/blender/editors/interface/interface_draw.c View 4 chunks +8 lines, -6 lines 0 comments Download
source/blender/editors/interface/interface_layout.h View 1 1 chunk +127 lines, -0 lines 0 comments Download
source/blender/editors/interface/interface_layout.c View 4 chunks +21 lines, -98 lines 0 comments Download
source/blender/editors/interface/interface_node_layout.c View 1 2 1 chunk +328 lines, -0 lines 0 comments Download
source/blender/editors/interface/interface_templates.c View 1 chunk +1 line, -1 line 0 comments Download
source/blender/editors/interface/interface_widgets.c View 1 chunk +10 lines, -7 lines 0 comments Download
source/blender/editors/space_node/drawnode.c View 1 2 4 chunks +7 lines, -7 lines 0 comments Download
source/blender/editors/space_node/node_draw.c View 1 2 12 chunks +57 lines, -259 lines 0 comments Download
source/blender/editors/space_node/node_intern.h View 1 2 3 chunks +3 lines, -10 lines 1 comment Download
source/blender/makesdna/DNA_node_types.h View 2 chunks +3 lines, -2 lines 0 comments Download
source/blender/makesrna/intern/rna_internal.h View 1 chunk +1 line, -0 lines 0 comments Download
source/blender/makesrna/intern/rna_nodetree.c View 6 chunks +6 lines, -5 lines 0 comments Download
source/blender/makesrna/intern/rna_ui.c View 3 chunks +13 lines, -0 lines 0 comments Download
source/blender/makesrna/intern/rna_ui_api.c View 4 chunks +45 lines, -16 lines 0 comments Download

Messages

Total messages: 5
lukas.toenne1
10 years, 6 months ago (2013-10-14 13:50:37 UTC) #1
lukas.toenne1
Moved node_layout.c into interface folder to avoid bad level includes
10 years, 6 months ago (2013-10-14 14:57:56 UTC) #2
lukas.toenne1
Avoid bad-level node_intern.h include by moving stuff into the ED_node.h
10 years, 6 months ago (2013-10-14 15:09:29 UTC) #3
brechtvl
I did not look into the code, but I have some doubts about this. If ...
10 years, 6 months ago (2013-10-14 16:36:44 UTC) #4
b.mont29
10 years, 6 months ago (2013-10-14 16:53:38 UTC) #5
Made a very quick review… Only a few details spotted, did not have time to
really check all that new code.

https://codereview.appspot.com/14433064/diff/16001/source/blender/editors/inc...
File source/blender/editors/include/ED_node.h (right):

https://codereview.appspot.com/14433064/diff/16001/source/blender/editors/inc...
source/blender/editors/include/ED_node.h:48: struct uiLayout;
Guess uiLayout is no more needed here?

https://codereview.appspot.com/14433064/diff/16001/source/blender/editors/spa...
File source/blender/editors/space_node/node_intern.h (right):

https://codereview.appspot.com/14433064/diff/16001/source/blender/editors/spa...
source/blender/editors/space_node/node_intern.h:52: struct uiLayout;
Same remark here, think uiLayout is no more needed here. ;)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b