diff options
author | Hans Goudey <h.goudey@me.com> | 2021-01-20 01:43:08 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-20 01:43:08 +0300 |
commit | 6290091bace2fc7654dd3052b8b2553310cead13 (patch) | |
tree | 15ac3d25dac4a45ca1cac01fc60dcd2782880099 /source/blender/editors/space_node/node_intern.h | |
parent | da6dea5701311f41c7d70429b111b901b6bcf966 (diff) |
Cleanup: Store runtime space node variables in a separate struct
This commit moves runtime-only variables from the `SpaceNode`
DNA struct to a private struct in `node_intern.h`. Before, it was hard
to tell which data needed to be saved in files, this should make it
more clear.
Node that the `edittree` field is basically a runtime variable, since
it's set from the `treepath` list on read, but moving it would require
some more invasive changes that I don't think are worth it right now.
Also, not all of the moved variables were explicitly cleared on read--
`aspect` is set at the start of a redraw, `cursor` is set in a region
callback, and `recalc` was used as an update flag.
Differential Revision: https://developer.blender.org/D10141
Diffstat (limited to 'source/blender/editors/space_node/node_intern.h')
-rw-r--r-- | source/blender/editors/space_node/node_intern.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 16c166ef5b1..a2b04fa9665 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -37,6 +37,7 @@ struct bContext; struct bNode; struct bNodeLink; struct bNodeSocket; +struct NodeInsertOfsData; struct wmGizmoGroupType; struct wmKeyConfig; struct wmWindow; @@ -53,6 +54,23 @@ typedef struct bNodeLinkDrag { int in_out; } bNodeLinkDrag; +typedef struct SpaceNode_Runtime { + float aspect; + + /** Mouse position for drawing socket-less links and adding nodes. */ + float cursor[2]; + + /** For auto compositing. */ + bool recalc; + + /** Temporary data for modal linking operator. */ + struct ListBase linkdrag; + + /* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */ + /** Temporary data for node insert offset (in UI called Auto-offset). */ + struct NodeInsertOfsData *iofsd; +} SpaceNode_Runtime; + /* space_node.c */ /* transform between View2Ds in the tree path */ |