svn merge ^/trunk/blender -r44235:44250
authorCampbell Barton <ideasman42@gmail.com>
Sun, 19 Feb 2012 17:59:30 +0000 (17:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 19 Feb 2012 17:59:30 +0000 (17:59 +0000)
1  2 
source/blender/editors/object/object_edit.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/windowmanager/intern/wm_gesture.c

@@@ -4833,27 -4860,108 +4833,28 @@@ void initEdgeSlide(TransInfo *t
  static int doEdgeSlide(TransInfo *t, float perc)
  {
        SlideData *sld = t->customData;
 -      EditVert *ev, *nearest = sld->nearest;
 -      EditVert *centerVert, *upVert, *downVert;
 -      LinkNode *vertlist=sld->vertlist, *look;
 -      GHash *vertgh = sld->vhash;
 -      TransDataSlideVert *tempsv;
 -      float len;
 -      int prop=1, flip=0;
 -      /* UV correction vars */
 -      GHash **uvarray= sld->uvhash;
 -      const int  uvlay_tot= sld->uvlay_tot;
 -      int uvlay_idx;
 -      TransDataSlideUv *suv;
 -      float uv_tmp[2];
 -      LinkNode *fuv_link;
 -
 -      tempsv = BLI_ghash_lookup(vertgh,nearest);
 -
 -      centerVert = editedge_getSharedVert(tempsv->up, tempsv->down);
 -      upVert = editedge_getOtherVert(tempsv->up, centerVert);
 -      downVert = editedge_getOtherVert(tempsv->down, centerVert);
 -
 -      len = minf(perc, len_v3v3(upVert->co, downVert->co));
 -      len = maxf(len, 0.0f);
 -
 -      //Adjust Edgeloop
 -      if(prop) {
 -              look = vertlist;
 -              while(look) {
 -                      EditVert *tempev;
 -                      ev = look->link;
 -                      tempsv = BLI_ghash_lookup(vertgh,ev);
 -
 -                      tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev);
 -                      interp_v3_v3v3(ev->co, tempsv->origvert.co, tempev->co, fabs(perc));
 -
 -                      if (uvlay_tot) {
 -                              for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
 -                                      suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
 -                                      if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
 -                                              interp_v2_v2v2(uv_tmp, suv->origuv,  (perc>=0)?suv->uv_up:suv->uv_down, fabs(perc));
 -                                              fuv_link = suv->fuv_list;
 -                                              while (fuv_link) {
 -                                                      copy_v2_v2(((float *)fuv_link->link), uv_tmp);
 -                                                      fuv_link = fuv_link->next;
 -                                              }
 -                                      }
 -                              }
 -                      }
 +      TransDataSlideVert *svlist = sld->sv, *sv;
 +      float vec[3];
 +      int i;
  
 -                      look = look->next;
 +      sld->perc = perc;
 +
 +      sv = svlist;
 +      for (i=0; i<sld->totsv; i++, sv++) {
 +              if (perc > 0.0f) {
 +                      copy_v3_v3(vec, sv->upvec);
 +                      mul_v3_fl(vec, perc);
 +                      add_v3_v3v3(sv->v->co, sv->origvert.co, vec);
-               } else {
+               }
 -      }
 -      else {
 -              //Non prop code
 -              look = vertlist;
 -              while(look) {
 -                      float newlen, edgelen;
 -                      ev = look->link;
 -                      tempsv = BLI_ghash_lookup(vertgh,ev);
 -                      edgelen = len_v3v3(editedge_getOtherVert(tempsv->up,ev)->co,editedge_getOtherVert(tempsv->down,ev)->co);
 -                      newlen = (edgelen != 0.0f)? (len / edgelen): 0.0f;
 -                      if(newlen > 1.0f) {newlen = 1.0;}
 -                      if(newlen < 0.0f) {newlen = 0.0;}
 -                      if(flip == 0) {
 -                              interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen));
 -                              if (uvlay_tot) {
 -                                      /* dont do anything if no UVs */
 -                                      for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
 -                                              suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
 -                                              if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
 -                                                      interp_v2_v2v2(uv_tmp, suv->uv_down, suv->uv_up, fabs(newlen));
 -                                                      fuv_link = suv->fuv_list;
 -                                                      while (fuv_link) {
 -                                                              copy_v2_v2(((float *)fuv_link->link), uv_tmp);
 -                                                              fuv_link = fuv_link->next;
 -                                                      }
 -                                              }
 -                                      }
 -                              }
 -                      } else{
 -                              interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen));
 -
 -                              if (uvlay_tot) {
 -                                      /* dont do anything if no UVs */
 -                                      for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
 -                                              suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
 -                                              if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
 -                                                      interp_v2_v2v2(uv_tmp, suv->uv_up, suv->uv_down, fabs(newlen));
 -                                                      fuv_link = suv->fuv_list;
 -                                                      while (fuv_link) {
 -                                                              copy_v2_v2(((float *)fuv_link->link), uv_tmp);
 -                                                              fuv_link = fuv_link->next;
 -                                                      }
 -                                              }
 -                                      }
 -                              }
 -                      }
 -                      look = look->next;
++              else {
 +                      copy_v3_v3(vec, sv->downvec);
 +                      mul_v3_fl(vec, -perc);
 +                      add_v3_v3v3(sv->v->co, sv->origvert.co, vec);
                }
 -
        }
 -
 +      
 +      projectSVData(t, 0);
 +      
        return 1;
  }