svn merge -r37900:38000 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / blender / editors / object / object_relations.c
index f3b67867d7ff45af18c6fadbda8d74650b52ec35..bf21c4c0f6290df70fe14d68c5d9f46f96ab5035 100644 (file)
@@ -76,6 +76,7 @@
 #include "BKE_sca.h"
 #include "BKE_scene.h"
 #include "BKE_texture.h"
+#include "BKE_tessmesh.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -108,7 +109,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;
@@ -120,22 +122,17 @@ 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;
                                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= curve_get_editcurve(obedit);
@@ -1134,6 +1131,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;