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:
authorJoshua Leung <aligorith@gmail.com>2009-11-20 07:19:57 +0300
committerJoshua Leung <aligorith@gmail.com>2009-11-20 07:19:57 +0300
commite6d382bd5353e526c21d3f3f021560fd58d07c41 (patch)
tree43d51f9c7b9df4c16b281a0a09510cbc35c4c6d1 /source/blender/editors/space_node/node_ops.c
parent3d1e618864422cacfd73442f2847bbe68d96fada (diff)
Node Editor: Various usability and code tidyups
* Fixed a nasty bug which meant that it was impossible to set an active node. Was caused by ntreeCopyTree() getting called when compo updates were done and clearing the active flags. The active flag clearing is only really needed for the "internal_select" case which is only used for duplicating selected nodes (from Shift-D duplicate). * Recoded click-selection code. Was a mess of old code, bad exceptions from the old code half ported, duplicate operators, unnecessary flags/modes. * Fixed bug #19927: compositing node groups can't be access via "tab" or ungrouped via "alt+g". Was probably related to the active group not being able to be set. * Made resizing nodes work again. Again, this was due to the active node bug. * Made adding a new group with Ctrl-G correctly update the views
Diffstat (limited to 'source/blender/editors/space_node/node_ops.c')
-rw-r--r--source/blender/editors/space_node/node_ops.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c
index a77ba68dc24..ed199bd69d0 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -52,7 +52,6 @@ void node_operatortypes(void)
WM_operatortype_append(NODE_OT_properties);
WM_operatortype_append(NODE_OT_select);
- WM_operatortype_append(NODE_OT_select_extend);
WM_operatortype_append(NODE_OT_select_all);
WM_operatortype_append(NODE_OT_select_linked_to);
WM_operatortype_append(NODE_OT_select_linked_from);
@@ -72,7 +71,7 @@ void node_operatortypes(void)
void node_keymap(struct wmKeyConfig *keyconf)
{
wmKeyMap *keymap;
-// wmKeyMapItem *kmi;
+ wmKeyMapItem *kmi;
/* Entire Editor only ----------------- */
keymap= WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0);
@@ -82,18 +81,24 @@ void node_keymap(struct wmKeyConfig *keyconf)
/* Main Area only ----------------- */
keymap= WM_keymap_find(keyconf, "Node", SPACE_NODE, 0);
- /* mouse select in nodes used to be both keys, it's UI elements... */
- RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, 0, 0)->ptr, "select_type", NODE_SELECT_MOUSE);
- RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select", SELECTMOUSE, KM_PRESS, 0, 0)->ptr, "select_type", NODE_SELECT_MOUSE);
- RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select_extend", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select_type", NODE_SELECT_MOUSE);
- RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select_extend", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select_type", NODE_SELECT_MOUSE);
-
- WM_keymap_add_item(keymap, "NODE_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
+ /* mouse select in nodes used to be both keys, but perhaps this should be reduced?
+ * NOTE: mouse-clicks on left-mouse will fall through to allow transform-tweak, but also link/resize
+ */
+ WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "NODE_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
+ kmi= WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
+ RNA_boolean_set(kmi->ptr, "extend", 1);
+ kmi= WM_keymap_add_item(keymap, "NODE_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
+ RNA_boolean_set(kmi->ptr, "extend", 1);
+ /* each of these falls through if not handled... */
WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "NODE_OT_resize", LEFTMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "NODE_OT_resize", LEFTMOUSE, KM_PRESS, 0, 0); // XXX not working..
WM_keymap_add_item(keymap, "NODE_OT_visibility_toggle", LEFTMOUSE, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "NODE_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_ALT, 0);
+
+ WM_keymap_add_item(keymap, "NODE_OT_links_cut", RIGHTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
+
+ WM_keymap_add_item(keymap, "NODE_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "NODE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "NODE_OT_select_border", BKEY, KM_PRESS, 0, 0);