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.
This commit is contained in:
2010-05-12 12:03:38 +00:00
parent 285a73d274
commit 9a4ba57ee9
5 changed files with 62 additions and 0 deletions

View File

@@ -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;
}