diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2015-08-01 18:39:48 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2015-08-01 18:56:44 +0300 |
commit | 47bc66fc8dfe2b89e2b5be029c63f9043c8c2174 (patch) | |
tree | d9756829bb6313f82f7ae99e467ec65580156a40 /release/scripts | |
parent | 31bf82c17d780660160ebf4e1a4be004b8933b9d (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 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_operators/node.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_node.py | 3 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index e8b1ed248a3..3d54b133a76 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -125,7 +125,7 @@ class NodeAddOperator: if self.use_transform and ('FINISHED' in result): # removes the node again if transform is canceled - bpy.ops.transform.translate('INVOKE_DEFAULT', remove_on_cancel=True) + bpy.ops.node.translate_attach_remove_on_cancel('INVOKE_DEFAULT') return result diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 4fc93fafc4d..3941e618b5b 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -115,6 +115,9 @@ class NODE_HT_header(Header): layout.separator() + # Auto-offset nodes (called "insert_offset" in code) + layout.prop(snode, "use_insert_offset", text="") + # Snap row = layout.row(align=True) row.prop(toolsettings, "use_snap", text="") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 6be24a8d551..3783ae2272d 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -313,6 +313,8 @@ class USERPREF_PT_edit(Panel): col.separator() col.separator() col.separator() + col.label(text="Node Editor:") + col.prop(edit, "node_margin") col.label(text="Animation Editors:") col.prop(edit, "fcurve_unselected_alpha", text="F-Curve Visibility") |