Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-04-15 09:57:10 +0300
committerJacques Lucke <jacques@blender.org>2021-04-15 10:00:47 +0300
commit3810bcc1604756f433b5b799b66d8b81645767ca (patch)
treede0ba2c5ca0cbadf3838959a19475d19cce994df /source/blender/editors/space_node/node_edit.c
parent0bac7682239f2ee117a80ed3ce62a1877331c974 (diff)
Spreadsheet: breadcrumbs and node pinning
This introduces a context path to the spreadsheet editor, which contains information about what data is shown in the spreadsheet. The context path (breadcrumbs) can reference a specific node in a node group hierarchy. During object evaluation, the geometry nodes modifier checks what data is currently requested by visible spreadsheets and stores the corresponding geometry sets separately for later access. The context path can be updated by the user explicitely, by clicking on the new icon in the header of nodes. Under some circumstances, the context path is updated automatically based on Blender's context. This patch also consolidates the "Node" and "Final" object evaluation mode to just "Evaluated". Based on the current context path, either the final geometry set of an object will be displayed, or the data at a specific node. The new preview icon in geometry nodes now behaves more like a toggle. It can be clicked again to clear the context path in an open spreadsheet editor. Previously, only an object could be pinned in the spreadsheet editor. Now it is possible to pin the entire context path. That allows two different spreadsheets to display geometry data from two different nodes. The breadcrumbs in the spreadsheet header can be collapsed by clicking on the arrow icons. It's not ideal but works well for now. This might be changed again, if we get a data set region on the left. Differential Revision: https://developer.blender.org/D10931
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r--source/blender/editors/space_node/node_edit.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 1cbd0fd607c..7282ed4b667 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -1694,55 +1694,6 @@ void NODE_OT_hide_socket_toggle(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static void disable_active_preview_on_all_nodes(bNodeTree *ntree)
-{
- LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- node->flag &= ~NODE_ACTIVE_PREVIEW;
- }
-}
-
-static int node_active_preview_toggle_exec(bContext *C, wmOperator *UNUSED(op))
-{
- SpaceNode *snode = CTX_wm_space_node(C);
- Main *bmain = CTX_data_main(C);
- bNodeTree *ntree = snode->edittree;
- disable_active_preview_on_all_nodes(ntree);
- bNode *active_node = nodeGetActive(ntree);
- active_node->flag |= NODE_ACTIVE_PREVIEW;
-
- /* Tag for update, so that dependent objects are reevaluated. This is necessary when a
- * spreadsheet editor displays data from a node. */
- LISTBASE_FOREACH (wmWindow *, window, &((wmWindowManager *)bmain->wm.first)->windows) {
- bScreen *screen = BKE_workspace_active_screen_get(window->workspace_hook);
- LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
- if (area->spacetype == SPACE_SPREADSHEET) {
- SpaceSpreadsheet *sspreadsheet = area->spacedata.first;
- if (sspreadsheet->object_eval_state == SPREADSHEET_OBJECT_EVAL_STATE_NODE) {
- DEG_id_tag_update(&ntree->id, ID_RECALC_COPY_ON_WRITE);
- ED_area_tag_redraw(area);
- }
- }
- }
- }
-
- return OPERATOR_FINISHED;
-}
-
-void NODE_OT_active_preview_toggle(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "Toggle Active Preview";
- ot->description = "Toggle active preview state of node";
- ot->idname = "NODE_OT_active_preview_toggle";
-
- /* callbacks */
- ot->exec = node_active_preview_toggle_exec;
- ot->poll = ED_operator_node_active;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
/* ****************** Mute operator *********************** */
static int node_mute_exec(bContext *C, wmOperator *UNUSED(op))