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:
authorJulian Eisel <eiseljulian@gmail.com>2015-08-01 18:39:48 +0300
committerJulian Eisel <eiseljulian@gmail.com>2015-08-01 18:56:44 +0300
commit47bc66fc8dfe2b89e2b5be029c63f9043c8c2174 (patch)
treed9756829bb6313f82f7ae99e467ec65580156a40 /source/blender/makesdna
parent31bf82c17d780660160ebf4e1a4be004b8933b9d (diff)
Note Editor: Auto-offset nodes on insertion
Implements "Auto-offset" (called "insert offset" in code) feature for Node Editor, developed during and after LSOC :) Idea and sponsoring by Sebastian König, blendFX, Mathias Eimann, Mikavaa, Knick Design When you drop a node with at least one input and one output socket onto a an existing connection between two nodes, Auto-offset will, depending on the direction setting, automatically and animated move the left or right and all of its following nodes away to make room for the new node. The direction for offsetting can be toggled while you are moving the node by pressing „T“. The auto-offset is enabled by default but can be disabled in the header of the node-editor. The offset margin can be changed in the editing section of the User Preferences. Thanks a lot to the sponsors, and especially to Sebastian who helped *a lot* with this. That's how users can help developing Blender!
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_node_types.h2
-rw-r--r--source/blender/makesdna/DNA_space_types.h26
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h3
3 files changed, 23 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 1bbd0ab8416..17b0dbca51c 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -191,6 +191,8 @@ typedef struct bNode {
float width, height; /* node custom width and height */
float miniwidth; /* node width if hidden */
float offsetx, offsety; /* additional offset from loc */
+ float anim_init_locx; /* initial locx for insert offset animation */
+ float anim_ofsx; /* offset that will be added to locx for insert offset animation */
int update; /* update flags */
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index ab19273f087..2a066726d96 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -985,12 +985,17 @@ typedef struct SpaceNode {
int treetype DNA_DEPRECATED; /* treetype: as same nodetree->type */
int pad3;
- short texfrom; /* texfrom object, world or brush */
- short shaderfrom; /* shader from object or world */
- short recalc; /* currently on 0/1, for auto compo */
- short pad4;
- ListBase linkdrag; /* temporary data for modal linking operator */
-
+ short texfrom; /* texfrom object, world or brush */
+ short shaderfrom; /* shader from object or world */
+ short recalc; /* currently on 0/1, for auto compo */
+
+ char insert_ofs_dir; /* direction for offsetting nodes on insertion */
+ char pad4;
+
+ ListBase linkdrag; /* temporary data for modal linking operator */
+ /* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */
+ struct NodeInsertOfsData *iofsd; /* temporary data for node insert offset (in UI called Auto-offset) */
+
struct bGPdata *gpd; /* grease-pencil data */
} SpaceNode;
@@ -1006,8 +1011,9 @@ typedef enum eSpaceNode_Flag {
SNODE_AUTO_RENDER = (1 << 5),
SNODE_SHOW_HIGHLIGHT = (1 << 6),
// SNODE_USE_HIDDEN_PREVIEW = (1 << 10), DNA_DEPRECATED December2013
- SNODE_NEW_SHADERS = (1 << 11),
+ SNODE_NEW_SHADERS = (1 << 11),
SNODE_PIN = (1 << 12),
+ SNODE_SKIP_INSOFFSET = (1 << 13), /* automatically offset following nodes in a chain on insertion */
} eSpaceNode_Flag;
/* snode->texfrom */
@@ -1025,6 +1031,12 @@ typedef enum eSpaceNode_ShaderFrom {
SNODE_SHADER_LINESTYLE = 2,
} eSpaceNode_ShaderFrom;
+/* snode->insert_ofs_dir */
+enum {
+ SNODE_INSERTOFS_DIR_RIGHT = 0,
+ SNODE_INSERTOFS_DIR_LEFT = 1,
+};
+
/* Game Logic Editor ===================================== */
/* Logic Editor */
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 803c2922ed9..bc2c7463e7f 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -465,7 +465,8 @@ typedef struct UserDef {
int scrollback; /* console scrollback limit */
int dpi; /* range 48-128? */
- char pad2[2];
+ char node_margin; /* node insert offset (aka auto-offset) margin, but might be useful for later stuff as well */
+ char pad2;
short transopts;
short menuthreshold1, menuthreshold2;