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:
authorHans Goudey <h.goudey@me.com>2021-01-20 01:43:08 +0300
committerHans Goudey <h.goudey@me.com>2021-01-20 01:43:08 +0300
commit6290091bace2fc7654dd3052b8b2553310cead13 (patch)
tree15ac3d25dac4a45ca1cac01fc60dcd2782880099 /source/blender/makesdna/DNA_space_types.h
parentda6dea5701311f41c7d70429b111b901b6bcf966 (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/makesdna/DNA_space_types.h')
-rw-r--r--source/blender/makesdna/DNA_space_types.h35
1 files changed, 14 insertions, 21 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 03f5d3f8d47..a1ccf11b8e3 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -63,6 +63,9 @@ struct wmTimer;
/* Defined in `buttons_intern.h`. */
typedef struct SpaceProperties_Runtime SpaceProperties_Runtime;
+/* Defined in `node_intern.h`. */
+typedef struct SpaceNode_Runtime SpaceNode_Runtime;
+
/* -------------------------------------------------------------------- */
/** \name SpaceLink (Base)
* \{ */
@@ -1518,19 +1521,17 @@ typedef struct SpaceNode {
/** Context, no need to save in file? well... pinning... */
struct ID *id, *from;
- /** Menunr: browse id block in header. */
+
short flag;
- char _pad1[2];
- /** Internal state variables. */
- float aspect;
- char _pad2[4];
+
+ /** Direction for offsetting nodes on insertion. */
+ char insert_ofs_dir;
+ char _pad1;
/** Offset for drawing the backdrop. */
float xof, yof;
/** Zoom for backdrop. */
float zoom;
- /** Mouse pos for drawing socketless link and adding nodes. */
- float cursor[2];
/**
* XXX nodetree pointer info is all in the path stack now,
@@ -1541,33 +1542,25 @@ typedef struct SpaceNode {
*/
ListBase treepath;
- struct bNodeTree *nodetree, *edittree;
+ /* The tree farthest down in the group heirarchy. */
+ struct bNodeTree *edittree;
+
+ struct bNodeTree *nodetree;
/* tree type for the current node tree */
char tree_idname[64];
/** Treetype: as same nodetree->type. */
int treetype DNA_DEPRECATED;
- char _pad3[4];
/** Texfrom object, world or brush. */
short texfrom;
/** Shader from object or world. */
short shaderfrom;
- /** Currently on 0/1, for auto compo. */
- short recalc;
-
- /** Direction for offsetting nodes on insertion. */
- char insert_ofs_dir;
- char _pad4;
-
- /** Temporary data for modal linking operator. */
- 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;
/** Grease-pencil data. */
struct bGPdata *gpd;
+
+ SpaceNode_Runtime *runtime;
} SpaceNode;
/* SpaceNode.flag */