svn merge -r39890:39889 source/blender/editors/object/object_relations.c source...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 6 Sep 2011 01:23:43 +0000 (01:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 6 Sep 2011 01:23:43 +0000 (01:23 +0000)
This change has been reverted in trunk so reverse merging the merge.

1  2 
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_relations.c

index 98375ca03ce7fadbb273081c3c07eead0fff0d0b,266556773f09c22a2e6fb6655641d79c343ab318..01fab0813d4d3fc388a1b9fddefe63297bb6b864
@@@ -65,7 -64,7 +65,6 @@@
  
  #include "ED_curve.h"
  #include "ED_mesh.h"
--#include "ED_lattice.h"
  #include "ED_screen.h"
  
  #include "WM_types.h"
@@@ -298,7 -293,7 +297,7 @@@ static int return_editcurve_indexar(Obj
        return totvert;
  }
  
--static int object_hook_index_array(Scene *scene, Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
++static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
  {
        *indexar= NULL;
        *tot= 0;
                case OB_MESH:
                {
                        Mesh *me= obedit->data;
-                       BMEditMesh *em;
-                       EDBM_LoadEditBMesh(scene, obedit);
-                       EDBM_MakeEditBMesh(scene->toolsettings, scene, obedit);
-                       em = me->edit_btmesh;
 -                      EditMesh *em;
 -
 -                      load_editMesh(scene, obedit);
 -                      make_editMesh(scene, obedit);
 -
 -                      em = BKE_mesh_get_editmesh(me);
++                      BMEditMesh *em = me->edit_btmesh;
  
                        /* check selected vertices first */
                        if( return_editmesh_indexar(em, tot, indexar, cent_r)) {
                }
                case OB_CURVE:
                case OB_SURF:
--                      load_editNurb(obedit);
--                      make_editNurb(obedit);
 -
                        return return_editcurve_indexar(obedit, tot, indexar, cent_r);
                case OB_LATTICE:
                {
                        Lattice *lt= obedit->data;
 -
--                      load_editLatt(obedit);
--                      make_editLatt(obedit);
--
                        return return_editlattice_indexar(lt->editlatt->latt, tot, indexar, cent_r);
                }
                default:
@@@ -439,7 -440,7 +430,7 @@@ static void add_hook_object(Main *bmain
        int tot, ok, *indexar;
        char name[32];
        
--      ok = object_hook_index_array(scene, obedit, &tot, &indexar, name, cent);
++      ok = object_hook_index_array(obedit, &tot, &indexar, name, cent);
        
        if (!ok) return;        // XXX error("Requires selected vertices or active Vertex Group");
        
@@@ -772,7 -773,7 +763,7 @@@ static int object_hook_assign_exec(bCon
        
        /* assign functionality */
        
--      if(!object_hook_index_array(CTX_data_scene(C), ob, &tot, &indexar, name, cent)) {
++      if(!object_hook_index_array(ob, &tot, &indexar, name, cent)) {
                BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group");
                return OPERATOR_CANCELLED;
        }
index 9fe0b7d3210e28dee0518efda251ec9600c7fc86,b9208e778c7e52d80e4deea3776bf0e25c03305d..b79d355aa2a5b42683a0d82d534a7be232453f0e
@@@ -92,8 -91,8 +92,6 @@@
  
  #include "ED_armature.h"
  #include "ED_curve.h"
--#include "ED_lattice.h"
--#include "ED_mesh.h"
  #include "ED_keyframing.h"
  #include "ED_object.h"
  #include "ED_screen.h"
@@@ -126,30 -124,36 +124,21 @@@ static int vertex_parent_set_exec(bCont
        
        if(obedit->type==OB_MESH) {
                Mesh *me= obedit->data;
-               BMEditMesh *em;
-               EDBM_LoadEditBMesh(scene, obedit);
-               EDBM_MakeEditBMesh(scene->toolsettings, scene, obedit);
-               em = me->edit_btmesh;
 -              EditMesh *em;
++              BMEditMesh *em = me->edit_btmesh;
  
 -              load_editMesh(scene, obedit);
 -              make_editMesh(scene, obedit);
 -
 -              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;
--
--              load_editNurb(obedit);
--              make_editNurb(obedit);
--
--              editnurb= curve_get_editcurve(obedit);
++              ListBase *editnurb= curve_get_editcurve(obedit);
+               
                cu= obedit->data;
  
                nu= editnurb->first;
                }
        }
        else if(obedit->type==OB_LATTICE) {
--              Lattice *lt;
--
--              load_editLatt(obedit);
--              make_editLatt(obedit);
--
--              lt= obedit->data;
--
++              Lattice *lt= obedit->data;
++              
                a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
                bp= lt->editlatt->latt->def;
                while(a--) {