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:
authorDiego Borghetti <bdiego@gmail.com>2010-05-12 16:03:38 +0400
committerDiego Borghetti <bdiego@gmail.com>2010-05-12 16:03:38 +0400
commit9a4ba57ee9fc8005f734c961b73b99398880b37f (patch)
tree7019d844fe7b8d3636849fd838caf78e8e03f56e /source/blender/editors/space_node/node_select.c
parent285a73d274b6092b7a7dd5feb2013ab5c96234a1 (diff)
Node Space: Small feature for Venomgfx, Shift + F select node of the same type
This is a small request from Venomgfx, select a node and then press Shift + F to select all the nodes of the same type (of the active node). The key binding can be change, we thing in a "Find Next" (that is way the FKEY) with venomgfx, but no problem with change that. Also I add the entry in the select menu.
Diffstat (limited to 'source/blender/editors/space_node/node_select.c')
-rw-r--r--source/blender/editors/space_node/node_select.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 3ae1efb2f75..07e259cd0bb 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -363,3 +363,28 @@ void NODE_OT_select_linked_from(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
}
+/* ****** Select Same Type ****** */
+
+static int node_select_same_type_exec(bContext *C, wmOperator *op)
+{
+ SpaceNode *snode = CTX_wm_space_node(C);
+
+ node_select_same_type(snode);
+ WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ return OPERATOR_FINISHED;
+}
+
+void NODE_OT_select_same_type(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Select Same Type";
+ ot->description = "Select all the same type";
+ ot->idname = "NODE_OT_select_same_type";
+
+ /* api callbacks */
+ ot->exec = node_select_same_type_exec;
+ ot->poll = ED_operator_node_active;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+}