Object Select Similar tool now has a Pass Index option.

Patch by Jesse Werner.
This commit is contained in:
Brecht Van Lommel 2013-02-21 18:08:04 +00:00
parent b19168f4b1
commit 7a6919a74e

@ -527,6 +527,7 @@ static EnumPropertyItem prop_select_grouped_types[] = {
{11, "PROPERTIES", 0, "Properties", "Game Properties"},
{12, "KEYINGSET", 0, "Keying Set", "Objects included in active Keying Set"},
{13, "LAMP_TYPE", 0, "Lamp Type", "Matching lamp types"},
{14, "PASS_INDEX", 0, "Pass Index", "Matching object pass index"},
{0, NULL, 0, NULL, NULL}
};
@ -677,6 +678,20 @@ static short select_similar_lamps(bContext *C, Object *ob)
CTX_DATA_END;
return changed;
}
static short select_similar_pass_index(bContext *C, Object *ob)
{
char changed = 0;
CTX_DATA_BEGIN (C, Base *, base, selectable_bases)
{
if ((base->object->index == ob->index) && !(base->flag & SELECT)) {
ED_base_object_select(base, BA_SELECT);
changed = 1;
}
}
CTX_DATA_END;
return changed;
}
static short select_grouped_type(bContext *C, Object *ob)
{
short changed = 0;
@ -842,7 +857,8 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
else if (nr == 11) changed |= select_grouped_gameprops(C, ob);
else if (nr == 12) changed |= select_grouped_keyingset(C, ob);
else if (nr == 13) changed |= select_similar_lamps(C, ob);
else if (nr == 14) changed |= select_similar_pass_index(C, ob);
if (changed) {
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C));
return OPERATOR_FINISHED;