svn merge -r39877:39878 https://svn.blender.org/svnroot/bf-blender/trunk/blender...
[blender-staging.git] / source / blender / editors / object / object_relations.c
index b9208e778c7e52d80e4deea3776bf0e25c03305d..9fe0b7d3210e28dee0518efda251ec9600c7fc86 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"
@@ -112,7 +113,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;
@@ -124,27 +126,21 @@ 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 = me->edit_btmesh;
 
-               em = BKE_mesh_get_editmesh(me);
-
-               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;
                                else if(v4==0) v4= nr;
                                else break;
                        }
-                       nr++;
-                       eve= eve->next;
                }
-
-               BKE_mesh_end_editmesh(me, em);
        }
        else if(ELEM(obedit->type, OB_SURF, OB_CURVE)) {
                ListBase *editnurb;
@@ -153,7 +149,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
                make_editNurb(obedit);
 
                editnurb= curve_get_editcurve(obedit);
-               
+
                cu= obedit->data;
 
                nu= editnurb->first;
@@ -1153,6 +1149,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;