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/editors/space_node/node_ops.c
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/editors/space_node/node_ops.c')
-rw-r--r--source/blender/editors/space_node/node_ops.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c
index 474ad4db4af..7464fb77d90 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -92,6 +92,8 @@ void node_operatortypes(void)
WM_operatortype_append(NODE_OT_link_viewer);
+ WM_operatortype_append(NODE_OT_insert_offset);
+
WM_operatortype_append(NODE_OT_read_renderlayers);
WM_operatortype_append(NODE_OT_read_fullsamplelayers);
WM_operatortype_append(NODE_OT_render_changed);
@@ -147,6 +149,17 @@ void ED_operatormacros_node(void)
mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_boolean_set(mot->ptr, "release_confirm", true);
WM_operatortype_macro_define(ot, "NODE_OT_attach");
+ WM_operatortype_macro_define(ot, "NODE_OT_insert_offset");
+
+ /* NODE_OT_translate_attach with remove_on_canel set to true */
+ ot = WM_operatortype_append_macro("NODE_OT_translate_attach_remove_on_cancel", "Move and Attach",
+ "Move nodes and attach to frame",
+ OPTYPE_UNDO | OPTYPE_REGISTER);
+ mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
+ RNA_boolean_set(mot->ptr, "release_confirm", true);
+ RNA_boolean_set(mot->ptr, "remove_on_cancel", true);
+ WM_operatortype_macro_define(ot, "NODE_OT_attach");
+ WM_operatortype_macro_define(ot, "NODE_OT_insert_offset");
/* Note: Currently not in a default keymap or menu due to messy keymaps
* and tricky invoke functionality.