svn merge ^/trunk/blender -r40720:40872
[blender.git] / source / blender / editors / object / object_relations.c
index 389c0941cc247995981e5020f06976bf25976e29..16b7686f2691c2ef865019eb61c4bbd2da28309d 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"
@@ -93,9 +94,9 @@
 #include "ED_curve.h"
 #include "ED_keyframing.h"
 #include "ED_object.h"
+#include "ED_mesh.h"
 #include "ED_screen.h"
 #include "ED_view3d.h"
-#include "ED_mesh.h"
 
 #include "object_intern.h"
 
@@ -111,7 +112,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;
@@ -123,16 +125,15 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
        
        if(obedit->type==OB_MESH) {
                Mesh *me= obedit->data;
-               EditMesh *em;
+               BMEditMesh *em;
 
-               load_editMesh(scene, obedit);
-               make_editMesh(scene, obedit);
+               EDBM_LoadEditBMesh(scene, obedit);
+               EDBM_MakeEditBMesh(scene->toolsettings, scene, obedit);
 
-               em = BKE_mesh_get_editmesh(me);
+               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;
@@ -140,10 +141,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);
@@ -1142,6 +1140,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;