bmesh todo: material mesh select/deselect added.
This commit is contained in:
@@ -178,6 +178,8 @@ void EDBM_free_backbuf(void);
|
||||
int EDBM_init_backbuf_border(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
|
||||
int EDBM_init_backbuf_circle(struct ViewContext *vc, short xs, short ys, short rads);
|
||||
|
||||
void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const short select);
|
||||
|
||||
void EDBM_select_swap(struct BMEditMesh *em); /* exported for UV */
|
||||
void EDBM_set_actFace(struct BMEditMesh *em, struct BMFace *efa);
|
||||
|
||||
|
||||
@@ -1362,6 +1362,21 @@ void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode)
|
||||
}
|
||||
|
||||
|
||||
void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const short select)
|
||||
{
|
||||
BMIter iter;
|
||||
BMFace *efa;
|
||||
|
||||
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
|
||||
if (BM_TestHFlag(efa, BM_HIDDEN))
|
||||
continue;
|
||||
if(efa->mat_nr == index) {
|
||||
BM_Select(em->bm, efa, select);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EDBM_select_swap(BMEditMesh *em) /* exported for UV */
|
||||
{
|
||||
BMIter iter;
|
||||
|
||||
@@ -225,15 +225,11 @@ static int material_slot_de_select(bContext *C, int select)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
if(ob->type == OB_MESH) {
|
||||
/*BMESH_TODO
|
||||
BMEditMesh *em= ((Mesh*)ob->data)->edit_btmesh;
|
||||
|
||||
if(em) {
|
||||
if(select)
|
||||
EM_select_by_material(em, ob->actcol-1);
|
||||
else
|
||||
EM_deselect_by_material(em, ob->actcol-1);
|
||||
EDBM_deselect_by_material(em, ob->actcol-1, select);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else if ELEM(ob->type, OB_CURVE, OB_SURF) {
|
||||
ListBase *nurbs= ED_curve_editnurbs((Curve*)ob->data);
|
||||
|
||||
Reference in New Issue
Block a user