Object Select Similar tool now has a Pass Index option.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 21 Feb 2013 18:08:04 +0000 (18:08 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 21 Feb 2013 18:08:04 +0000 (18:08 +0000)
Patch by Jesse Werner.

source/blender/editors/object/object_select.c

index 07eca749a7480f5b6f32cbc53f9350be301a2421..775a289751385778f16d4bcf08112f2a7675217d 100644 (file)
@@ -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;