svn merge ^/trunk/blender -r43693:43733
authorCampbell Barton <ideasman42@gmail.com>
Thu, 26 Jan 2012 19:20:33 +0000 (19:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 26 Jan 2012 19:20:33 +0000 (19:20 +0000)
1  2 
release/scripts/presets/keyconfig/maya.py
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/particle_system.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_select.c

@@@ -3582,7 -3574,15 +3583,15 @@@ static void do_hair_dynamics(ParticleSi
        psys->clmd->point_cache = psys->pointcache;
        psys->clmd->sim_parms->effector_weights = psys->part->effector_weights;
  
-       psys->hair_out_dm = clothModifier_do(psys->clmd, sim->scene, sim->ob, dm);
+       deformedVerts = MEM_callocN(sizeof(*deformedVerts)*dm->getNumVerts(dm), "do_hair_dynamics vertexCos");
 -      psys->hair_out_dm = CDDM_copy(dm);
++      psys->hair_out_dm = CDDM_copy(dm, 0);
+       psys->hair_out_dm->getVertCos(psys->hair_out_dm, deformedVerts);
+       clothModifier_do(psys->clmd, sim->scene, sim->ob, dm, deformedVerts);
+       CDDM_apply_vert_coords(psys->hair_out_dm, deformedVerts);
+       MEM_freeN(deformedVerts);
  
        psys->clmd->sim_parms->effector_weights = NULL;
  }
@@@ -462,39 -460,39 +468,39 @@@ static void lasso_select_boundbox(rcti 
        }
  }
  
 -static void do_lasso_select_mesh__doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index))
 +static void do_lasso_select_mesh__doSelectVert(void *userData, BMVert *eve, int x, int y, int UNUSED(index))
  {
-       struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData;
+       LassoSelectUserData *data = userData;
  
        if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) {
-               BM_Select(data->vc.em->bm, eve, data->select);
 -              eve->f = data->select?(eve->f|1):(eve->f&~1);
++              BM_Select(data->vc->em->bm, eve, data->select);
        }
  }
 -static void do_lasso_select_mesh__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
 +static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index)
  {
-       struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData;
+       LassoSelectUserData *data = userData;
  
 -      if (EM_check_backbuf(em_solidoffs+index)) {
 +      if (EDBM_check_backbuf(bm_solidoffs+index)) {
                if (data->pass==0) {
                        if (    edge_fully_inside_rect(data->rect, x0, y0, x1, y1)  &&
                                        lasso_inside(data->mcords, data->moves, x0, y0) &&
                                        lasso_inside(data->mcords, data->moves, x1, y1)) {
-                               BM_Select(data->vc.em->bm, eed, data->select);
 -                              EM_select_edge(eed, data->select);
++                              BM_Select(data->vc->em->bm, eed, data->select);
                                data->done = 1;
                        }
                } else {
                        if (lasso_inside_edge(data->mcords, data->moves, x0, y0, x1, y1)) {
-                               BM_Select(data->vc.em->bm, eed, data->select);
 -                              EM_select_edge(eed, data->select);
++                              BM_Select(data->vc->em->bm, eed, data->select);
                        }
                }
        }
  }
 -static void do_lasso_select_mesh__doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index))
 +static void do_lasso_select_mesh__doSelectFace(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
  {
-       struct { ViewContext vc; rcti *rect; int (*mcords)[2], moves, select, pass, done; } *data = userData;
+       LassoSelectUserData *data = userData;
  
        if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) {
-               BM_Select(data->vc.em->bm, efa, data->select);
 -              EM_select_face_fgon(data->vc->em, efa, data->select);
++              BM_Select(data->vc->em->bm, efa, data->select);
        }
  }
  
@@@ -508,9 -506,9 +514,9 @@@ static void do_lasso_select_mesh(ViewCo
        lasso_select_boundbox(&rect, mcords, moves);
        
        /* set editmesh */
 -      vc->em= ((Mesh *)vc->obedit->data)->edit_mesh;
 +      vc->em= ((Mesh *)vc->obedit->data)->edit_btmesh;
  
-       data.vc= *vc;
+       data.vc= vc;
        data.rect = &rect;
        data.mcords = mcords;
        data.moves = moves;
@@@ -1725,37 -1728,37 +1736,37 @@@ static int do_lattice_box_select(ViewCo
        return OPERATOR_FINISHED;
  }
  
 -static void do_mesh_box_select__doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index))
 +static void do_mesh_box_select__doSelectVert(void *userData, BMVert *eve, int x, int y, int UNUSED(index))
  {
-       struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData;
+       BoxSelectUserData *data = userData;
  
        if (BLI_in_rcti(data->rect, x, y)) {
-               BM_Select(data->vc.em->bm, eve, data->select);
 -              eve->f = data->select?(eve->f|1):(eve->f&~1);
++              BM_Select(data->vc->em->bm, eve, data->select);
        }
  }
 -static void do_mesh_box_select__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
 +static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index)
  {
-       struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData;
+       BoxSelectUserData *data = userData;
  
 -      if(EM_check_backbuf(em_solidoffs+index)) {
 +      if(EDBM_check_backbuf(bm_solidoffs+index)) {
                if (data->pass==0) {
                        if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) {
-                               BM_Select(data->vc.em->bm, eed, data->select);
 -                              EM_select_edge(eed, data->select);
++                              BM_Select(data->vc->em->bm, eed, data->select);
                                data->done = 1;
                        }
                } else {
                        if (edge_inside_rect(data->rect, x0, y0, x1, y1)) {
-                               BM_Select(data->vc.em->bm, eed, data->select);
 -                              EM_select_edge(eed, data->select);
++                              BM_Select(data->vc->em->bm, eed, data->select);
                        }
                }
        }
  }
 -static void do_mesh_box_select__doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index))
 +static void do_mesh_box_select__doSelectFace(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
  {
-       struct { ViewContext vc; rcti *rect; short select, pass, done; } *data = userData;
+       BoxSelectUserData *data = userData;
  
        if (BLI_in_rcti(data->rect, x, y)) {
-               BM_Select(data->vc.em->bm, efa, data->select);
 -              EM_select_face_fgon(data->vc->em, efa, data->select);
++              BM_Select(data->vc->em->bm, efa, data->select);
        }
  }
  static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int extend)
@@@ -2259,27 -2262,34 +2270,34 @@@ void VIEW3D_OT_select(wmOperatorType *o
  
  /* -------------------- circle select --------------------------------------------- */
  
 -static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y, int UNUSED(index))
+ typedef struct CircleSelectUserData {
+       ViewContext *vc;
+       short select;
+       int mval[2];
+       float radius;
+ } CircleSelectUserData;
 +static void mesh_circle_doSelectVert(void *userData, BMVert *eve, int x, int y, int UNUSED(index))
  {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
        int mx = x - data->mval[0], my = y - data->mval[1];
        float r = sqrt(mx*mx + my*my);
  
        if (r<=data->radius) {
 -              eve->f = data->select?(eve->f|1):(eve->f&~1);
 +              BM_Select(data->vc->em->bm, eve, data->select);
        }
  }
 -static void mesh_circle_doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index))
 +static void mesh_circle_doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index))
  {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
  
        if (edge_inside_circle(data->mval[0], data->mval[1], (short) data->radius, x0, y0, x1, y1)) {
 -              EM_select_edge(eed, data->select);
 +              BM_Select(data->vc->em->bm, eed, data->select);
        }
  }
 -static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y, int UNUSED(index))
 +static void mesh_circle_doSelectFace(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
  {
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
+       CircleSelectUserData *data = userData;
        int mx = x - data->mval[0], my = y - data->mval[1];
        float r = sqrt(mx*mx + my*my);
        
@@@ -2292,12 -2302,12 +2310,12 @@@ static void mesh_circle_select(ViewCont
  {
        ToolSettings *ts= vc->scene->toolsettings;
        int bbsel;
-       struct {ViewContext *vc; short select; int mval[2]; float radius; } data;
+       CircleSelectUserData data;
        
 -      bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f));
 +      bbsel= EDBM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0));
        ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
  
 -      vc->em= ((Mesh *)vc->obedit->data)->edit_mesh;
 +      vc->em= ((Mesh *)vc->obedit->data)->edit_btmesh;
  
        data.vc = vc;
        data.select = select;
@@@ -2354,13 -2364,13 +2372,13 @@@ static void paint_vertsel_circle_select
        Object *ob= vc->obact;
        Mesh *me = ob?ob->data:NULL;
        /* int bbsel; */ /* UNUSED */
-       /* struct {ViewContext *vc; short select; int mval[2]; float radius; } data = {NULL}; */ /* UNUSED */
+       /* CircleSelectUserData data = {NULL}; */ /* UNUSED */
        if (me) {
 -              em_vertoffs= me->totvert+1;     /* max index array */
 +              bm_vertoffs= me->totvert+1;     /* max index array */
  
 -              /* bbsel= */ /* UNUSED */ EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f));
 -              EM_backbuf_checkAndSelectVerts_obmode(me, select==LEFTMOUSE);
 -              EM_free_backbuf();
 +              /* bbsel= */ /* UNUSED */ EDBM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f));
 +              EDBM_backbuf_checkAndSelectVerts_obmode(me, select==LEFTMOUSE);
 +              EDBM_free_backbuf();
  
                paintvert_flush_flags(ob);
        }