merge with/from trunk at r35190
[blender.git] / source / blender / editors / render / render_shading.c
index c3b2ad38c4655cedb5d864d42db1702f2753a607..e4e3ee7576cd0d17406e8f5f0cf09775aa025179 100644 (file)
@@ -60,6 +60,7 @@
 #include "BKE_scene.h"
 #include "BKE_texture.h"
 #include "BKE_world.h"
+#include "BKE_tessmesh.h"
 
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
@@ -329,13 +330,15 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
 
        if(ob && ob->actcol>0) {
                if(ob->type == OB_MESH) {
-                       EditMesh *em= ((Mesh*)ob->data)->edit_mesh;
-                       EditFace *efa;
+                       BMEditMesh *em= ((Mesh*)ob->data)->edit_btmesh;
+                       BMFace *efa;
+                       BMIter iter;
 
                        if(em) {
-                               for(efa= em->faces.first; efa; efa=efa->next)
-                                       if(efa->f & SELECT)
+                               BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
+                                       if(BM_TestHFlag(efa, BM_SELECT))
                                                efa->mat_nr= ob->actcol-1;
+                               }
                        }
                }
                else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
@@ -387,14 +390,15 @@ static int material_slot_de_select(bContext *C, int select)
                return OPERATOR_CANCELLED;
 
        if(ob->type == OB_MESH) {
-               EditMesh *em= ((Mesh*)ob->data)->edit_mesh;
-
+               BMEditMesh *em= ((Mesh*)ob->data)->edit_btmesh;
+/*BMESH_TODO
                if(em) {
                        if(select)
                                EM_select_by_material(em, ob->actcol-1);
                        else
                                EM_deselect_by_material(em, ob->actcol-1);
                }
+*/
        }
        else if ELEM(ob->type, OB_CURVE, OB_SURF) {
                ListBase *nurbs= ED_curve_editnurbs((Curve*)ob->data);