diff options
author | Jacques Lucke <jacques@blender.org> | 2021-04-08 18:35:06 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-04-08 18:35:37 +0300 |
commit | c6ff722a1fcc632eacebcfc94417df466742ce5f (patch) | |
tree | 0b86327190d845c1d6b6975434caf5e2d3ac2528 /source/blender/editors/space_node/node_draw.cc | |
parent | 5e77ff79ccdaffb2df4d54c97f17359c017c9b85 (diff) |
Spreadsheet: support showing data of specific node
Previously, the spreadsheet editor could only show data of the original
and of the final evaluated object. Now it is possible to show the data
at some intermediate stages too.
For that the mode has to be set to "Node" in the spreadsheet editor.
Furthermore, the preview of a specific node has to be activated by
clicking the new icon in the header of geometry nodes.
The exact ui of this feature might be refined in upcoming commits.
It is already very useful for debugging node groups in it's current
state though.
Differential Revision: https://developer.blender.org/D10875
Diffstat (limited to 'source/blender/editors/space_node/node_draw.cc')
-rw-r--r-- | source/blender/editors/space_node/node_draw.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 07a5dbe1d7b..88234c861a0 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -1404,6 +1404,28 @@ static void node_draw_basis(const bContext *C, ""); UI_block_emboss_set(node->block, UI_EMBOSS); } + if (ntree->type == NTREE_GEOMETRY) { + /* Active preview toggle. */ + iconofs -= iconbutw; + UI_block_emboss_set(node->block, UI_EMBOSS_NONE); + int icon = (node->flag & NODE_ACTIVE_PREVIEW) ? ICON_RESTRICT_VIEW_OFF : ICON_RESTRICT_VIEW_ON; + uiBut *but = uiDefIconBut(node->block, + UI_BTYPE_BUT_TOGGLE, + 0, + icon, + iconofs, + rct->ymax - NODE_DY, + iconbutw, + UI_UNIT_Y, + nullptr, + 0, + 0, + 0, + 0, + "Show this node's geometry output in the spreadsheet in Node mode"); + UI_but_func_set(but, node_toggle_button_cb, node, (void *)"NODE_OT_active_preview_toggle"); + UI_block_emboss_set(node->block, UI_EMBOSS); + } node_add_error_message_button(C, *ntree, *node, *rct, iconofs); |