Revision: 55629
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55629
Author:   ton
Date:     2013-03-27 18:28:25 +0000 (Wed, 27 Mar 2013)
Log Message:
-----------
Node Editor

To complete previous commit:

New "Activate same type next/prev" operator - replaces the two not working 
previous ones.
This selects/activates and views the next or previous node of same type.

Shortcuts: Shift ] and Shift [

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_node.py
    trunk/blender/source/blender/editors/space_node/node_intern.h
    trunk/blender/source/blender/editors/space_node/node_ops.c
    trunk/blender/source/blender/editors/space_node/node_select.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_node.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_node.py   2013-03-27 
17:22:12 UTC (rev 55628)
+++ trunk/blender/release/scripts/startup/bl_ui/space_node.py   2013-03-27 
18:28:25 UTC (rev 55629)
@@ -152,8 +152,8 @@
         layout.operator("node.select_linked_from")
         layout.operator("node.select_linked_to")
         layout.operator("node.select_same_type")
-        layout.operator("node.select_same_type_next")
-        layout.operator("node.select_same_type_prev")
+        layout.operator("node.select_same_type_step").prev = True
+        layout.operator("node.select_same_type_step").prev = False
 
 
 class NODE_MT_node(Menu):

Modified: trunk/blender/source/blender/editors/space_node/node_intern.h
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_intern.h       
2013-03-27 17:22:12 UTC (rev 55628)
+++ trunk/blender/source/blender/editors/space_node/node_intern.h       
2013-03-27 18:28:25 UTC (rev 55629)
@@ -121,9 +121,7 @@
 void NODE_OT_select_border(struct wmOperatorType *ot);
 void NODE_OT_select_lasso(struct wmOperatorType *ot);
 void NODE_OT_select_same_type(struct wmOperatorType *ot);
-void NODE_OT_select_same_type_next(struct wmOperatorType *ot);
-void NODE_OT_select_same_type_prev(struct wmOperatorType *ot);
-void NODE_OT_activate_connected(struct wmOperatorType *ot);
+void NODE_OT_select_same_type_step(struct wmOperatorType *ot);
 
 /* node_view.c */
 int space_node_view_flag(struct bContext *C, SpaceNode *snode, ARegion *ar, 
const int node_flag);

Modified: trunk/blender/source/blender/editors/space_node/node_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_ops.c  2013-03-27 
17:22:12 UTC (rev 55628)
+++ trunk/blender/source/blender/editors/space_node/node_ops.c  2013-03-27 
18:28:25 UTC (rev 55629)
@@ -58,9 +58,7 @@
        WM_operatortype_append(NODE_OT_select_border);
        WM_operatortype_append(NODE_OT_select_lasso);
        WM_operatortype_append(NODE_OT_select_same_type);
-       WM_operatortype_append(NODE_OT_select_same_type_next);
-       WM_operatortype_append(NODE_OT_select_same_type_prev);
-       WM_operatortype_append(NODE_OT_activate_connected);
+       WM_operatortype_append(NODE_OT_select_same_type_step);
        
        WM_operatortype_append(NODE_OT_view_all);
        WM_operatortype_append(NODE_OT_view_selected);
@@ -319,12 +317,10 @@
        WM_keymap_add_item(keymap, "NODE_OT_select_linked_to", LKEY, KM_PRESS, 
KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "NODE_OT_select_linked_from", LKEY, 
KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "NODE_OT_select_same_type", GKEY, KM_PRESS, 
KM_SHIFT, 0);
-//     WM_keymap_add_item(keymap, "NODE_OT_select_same_type_next", 
RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
-//     WM_keymap_add_item(keymap, "NODE_OT_select_same_type_prev", 
LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
 
-       kmi = WM_keymap_add_item(keymap, "NODE_OT_activate_connected", 
RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+       kmi = WM_keymap_add_item(keymap, "NODE_OT_select_same_type_step", 
RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_boolean_set(kmi->ptr, "prev", FALSE);
-       kmi = WM_keymap_add_item(keymap, "NODE_OT_activate_connected", 
LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+       kmi = WM_keymap_add_item(keymap, "NODE_OT_select_same_type_step", 
LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_boolean_set(kmi->ptr, "prev", TRUE);
        
        node_group_operators(keymap, "ShaderNodeGroup");

Modified: trunk/blender/source/blender/editors/space_node/node_select.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_select.c       
2013-03-27 17:22:12 UTC (rev 55628)
+++ trunk/blender/source/blender/editors/space_node/node_select.c       
2013-03-27 18:28:25 UTC (rev 55629)
@@ -762,65 +762,10 @@
 
 /* ****** Select The Next/Prev Node Of The Same Type ****** */
 
-static int node_select_same_type_next_exec(bContext *C, wmOperator *UNUSED(op))
-{
-       SpaceNode *snode = CTX_wm_space_node(C);
-
-       node_select_same_type_np(snode, 0);
-
-       ED_node_sort(snode->edittree);
-
-       WM_event_add_notifier(C, NC_NODE | NA_SELECTED, NULL);
-
-       return OPERATOR_FINISHED;
-}
-
-void NODE_OT_select_same_type_next(wmOperatorType *ot)
-{
-       /* identifiers */
-       ot->name = "Select Same Type Next";
-       ot->description = "Select the next node of the same type";
-       ot->idname = "NODE_OT_select_same_type_next";
-       
-       /* api callbacks */
-       ot->exec = node_select_same_type_next_exec;
-       ot->poll = ED_operator_node_active;
-       
-       /* flags */
-       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
-static int node_select_same_type_prev_exec(bContext *C, wmOperator *UNUSED(op))
-{
-       SpaceNode *snode = CTX_wm_space_node(C);
-
-       node_select_same_type_np(snode, 1);
-
-       ED_node_sort(snode->edittree);
-
-       WM_event_add_notifier(C, NC_NODE | NA_SELECTED, NULL);
-       return OPERATOR_FINISHED;
-}
-
-void NODE_OT_select_same_type_prev(wmOperatorType *ot)
-{
-       /* identifiers */
-       ot->name = "Select Same Type Prev";
-       ot->description = "Select the prev node of the same type";
-       ot->idname = "NODE_OT_select_same_type_prev";
-       
-       /* api callbacks */
-       ot->exec = node_select_same_type_prev_exec;
-       ot->poll = ED_operator_node_active;
-       
-       /* flags */
-       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
 /* ************************** */
 
 
-static int node_activate_connected_exec(bContext *C, wmOperator *op)
+static int node_select_same_type_step_exec(bContext *C, wmOperator *op)
 {
        SpaceNode *snode = CTX_wm_space_node(C);
        ARegion *ar = CTX_wm_region(C);
@@ -889,15 +834,15 @@
        return OPERATOR_FINISHED;
 }
 
-void NODE_OT_activate_connected(wmOperatorType *ot)
+void NODE_OT_select_same_type_step(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Activate/View Connected";
-       ot->description = "Activate and view connected nodes, step by step";
-       ot->idname = "NODE_OT_activate_connected";
+       ot->name = "Activate Same Type Next/Prev";
+       ot->description = "Activate and view same node type, step by step";
+       ot->idname = "NODE_OT_select_same_type_step";
        
        /* api callbacks */
-       ot->exec = node_activate_connected_exec;
+       ot->exec = node_select_same_type_step_exec;
        ot->poll = ED_operator_node_active;
        
        /* flags */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to