svn merge -r40166:40279 ^/trunk/blender
[blender.git] / source / blender / editors / object / object_relations.c
index 4d7f6fa..34496fa 100644 (file)
@@ -78,6 +78,7 @@
 #include "BKE_scene.h"
 #include "BKE_speaker.h"
 #include "BKE_texture.h"
+#include "BKE_tessmesh.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -110,7 +111,8 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
        Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
-       EditVert *eve;
+       BMVert *eve;
+       BMIter iter;
        Curve *cu;
        Nurb *nu;
        BezTriple *bezt;
@@ -122,11 +124,10 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
        
        if(obedit->type==OB_MESH) {
                Mesh *me= obedit->data;
-               EditMesh *em = BKE_mesh_get_editmesh(me);
+               BMEditMesh *em = me->edit_btmesh;
 
-               eve= em->verts.first;
-               while(eve) {
-                       if(eve->f & 1) {
+               BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+                       if (BM_TestHFlag(eve, BM_SELECT)) {
                                if(v1==0) v1= nr;
                                else if(v2==0) v2= nr;
                                else if(v3==0) v3= nr;
@@ -134,10 +135,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
                                else break;
                        }
                        nr++;
-                       eve= eve->next;
                }
-
-               BKE_mesh_end_editmesh(me, em);
        }
        else if(ELEM(obedit->type, OB_SURF, OB_CURVE)) {
                ListBase *editnurb= object_editcurve_get(obedit);
@@ -1136,6 +1134,8 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
        WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, scene);
        WM_event_add_notifier(C, NC_SCENE|ND_LAYER_CONTENT, scene);
 
+       WM_event_add_notifier(C, NC_SCENE|ND_LAYER_CONTENT, scene);
+
        DAG_scene_sort(bmain, scene);
 
        return OPERATOR_FINISHED;