svn merge ^/trunk/blender -r43443:43461
authorCampbell Barton <ideasman42@gmail.com>
Tue, 17 Jan 2012 17:08:32 +0000 (17:08 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 17 Jan 2012 17:08:32 +0000 (17:08 +0000)
1  2 
source/blender/blenkernel/CMakeLists.txt
source/blender/editors/mesh/loopcut.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/transform/transform_conversions.c
source/creator/CMakeLists.txt

index cfe260541c859a3e21206be8089fd7789a140e66,6ff62b16bde0df04300bdba4628bbf4484a6f67b..3205a1032f533e069661d2076aba86c6d01693c0
@@@ -49,7 -49,7 +50,6 @@@
  #include "BLI_blenlib.h"
  #include "BLI_dynstr.h" /*for WM_operator_pystring */
  #include "BLI_editVert.h"
- #include "BLI_array.h"
 -#include "BLI_math.h"
  #include "BLI_utildefines.h"
  
  #include "BKE_blender.h"
@@@ -59,9 -59,6 +59,8 @@@
  #include "BKE_modifier.h"
  #include "BKE_report.h"
  #include "BKE_scene.h"
- #include "BKE_array_mallocn.h"
 +#include "BKE_tessmesh.h"
 +#include "BKE_depsgraph.h"
  
  #include "BIF_gl.h"
  #include "BIF_glutil.h" /* for paint cursor */
@@@ -200,77 -152,107 +199,77 @@@ static void edgering_sel(tringselOpDat
        }
  
        if (!lcd->extend) {
 -              EM_clear_flag_all(lcd->em, SELECT);
 +              EDBM_clear_flag_all(lcd->em, BM_SELECT);
        }
  
 -      /* in eed->f1 we put the valence (amount of faces in edge) */
 -      /* in eed->f2 we put tagged flag as correct loop */
 -      /* in efa->f1 we put tagged flag as correct to select */
 +      if (select) {
 +              BMW_Init(&walker, em->bm, BMW_EDGERING,  0,0,0,0,  BMW_NIL_LAY);
 +              eed = BMW_Begin(&walker, startedge);
 +              for (; eed; eed=BMW_Step(&walker)) {
 +                      BM_Select(em->bm, eed, TRUE);
 +              }
 +              BMW_End(&walker);
  
 -      for(eed= em->edges.first; eed; eed= eed->next) {
 -              eed->f1= 0;
 -              eed->f2= 0;
 +              return;
        }
  
 -      for(efa= em->faces.first; efa; efa= efa->next) {
 -              efa->f1= 0;
 -              if(efa->h==0) {
 -                      efa->e1->f1++;
 -                      efa->e2->f1++;
 -                      efa->e3->f1++;
 -                      if(efa->e4) efa->e4->f1++;
 -              }
 -      }
 -      
 -      // tag startedge OK
 -      startedge->f2= 1;
 -      
 -      while(looking) {
 -              looking= 0;
 -              
 -              for(efa= em->faces.first; efa; efa= efa->next) {
 -                      if(efa->e4 && efa->f1==0 && efa->h == 0) {      // not done quad
 -                              if(efa->e1->f1<=2 && efa->e2->f1<=2 && efa->e3->f1<=2 && efa->e4->f1<=2) { // valence ok
 -
 -                                      // if edge tagged, select opposing edge and mark face ok
 -                                      if(efa->e1->f2) {
 -                                              efa->e3->f2= 1;
 -                                              efa->f1= 1;
 -                                              looking= 1;
 -                                      }
 -                                      else if(efa->e2->f2) {
 -                                              efa->e4->f2= 1;
 -                                              efa->f1= 1;
 -                                              looking= 1;
 -                                      }
 -                                      if(efa->e3->f2) {
 -                                              efa->e1->f2= 1;
 -                                              efa->f1= 1;
 -                                              looking= 1;
 -                                      }
 -                                      if(efa->e4->f2) {
 -                                              efa->e2->f2= 1;
 -                                              efa->f1= 1;
 -                                              looking= 1;
 -                                      }
 -                              }
 +      BMW_Init(&walker, em->bm, BMW_EDGERING,  0,0,0,0,  BMW_NIL_LAY);
 +      eed = startedge = BMW_Begin(&walker, startedge);
 +      lastv1 = NULL;
 +      for (lasteed=NULL; eed; eed=BMW_Step(&walker)) {
 +              if (lasteed) {
 +                      if (lastv1) {
 +                              v[1][0] = v[0][0];
 +                              v[1][1] = v[0][1];
 +                      } else {
 +                              v[1][0] = lasteed->v1;
 +                              v[1][1] = lasteed->v2;
 +                              lastv1 = lasteed->v1;
 +                      }
 +
 +                      edgering_find_order(em, lasteed, eed, lastv1, v);
 +                      lastv1 = v[0][0];
 +
 +                      for(i=1;i<=previewlines;i++){
 +                              co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0];
 +                              co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1];
 +                              co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2];
 +
 +                              co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0];
 +                              co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1];
 +                              co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2];                                        
 +                              
 +                              BLI_array_growone(edges);
 +                              VECCOPY(edges[tot][0], co[0]);
 +                              VECCOPY(edges[tot][1], co[1]);
 +                              tot++;
                        }
                }
 +              lasteed = eed;
        }
        
 -      if(previewlines > 0 && !select){
 -                      for(efa= em->faces.first; efa; efa= efa->next) {
 -                              if(efa->v4 == NULL) {  continue; }
 -                              if(efa->h == 0){
 -                                      if(efa->e1->f2 == 1){
 -                                              if(efa->e1->h == 1 || efa->e3->h == 1 )
 -                                                      continue;
 -                                              
 -                                              v[0][0] = efa->v1;
 -                                              v[0][1] = efa->v2;
 -                                              v[1][0] = efa->v4;
 -                                              v[1][1] = efa->v3;
 -                                      } else if(efa->e2->f2 == 1){
 -                                              if(efa->e2->h == 1 || efa->e4->h == 1)
 -                                                      continue;
 -                                              v[0][0] = efa->v2;
 -                                              v[0][1] = efa->v3;
 -                                              v[1][0] = efa->v1;
 -                                              v[1][1] = efa->v4;                                      
 -                                      } else { continue; }
 -                                                                                
 -                                      for(i=1;i<=previewlines;i++){
 -                                              co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0];
 -                                              co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1];
 -                                              co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2];
 -
 -                                              co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0];
 -                                              co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1];
 -                                              co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2];                                        
 -                                              
 -                                              BLI_array_growone(edges);
 -                                              copy_v3_v3(edges[tot][0], co[0]);
 -                                              copy_v3_v3(edges[tot][1], co[1]);
 -                                              tot++;
 -                                      }
 -                              }
 -                      }
 -      } else {
 -              select = (startedge->f & SELECT) == 0;
 +      if (lasteed != startedge && BM_Edge_Share_Faces(lasteed, startedge)) {
 +              v[1][0] = v[0][0];
 +              v[1][1] = v[0][1];
 +
 +              edgering_find_order(em, lasteed, startedge, lastv1, v);
 +              
 +              for(i=1;i<=previewlines;i++){
 +                      if (!v[0][0] || !v[0][1] || !v[1][0] || !v[1][1])
 +                              continue;
 +                      
 +                      co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0];
 +                      co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1];
 +                      co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2];
  
 -              /* select the edges */
 -              for(eed= em->edges.first; eed; eed= eed->next) {
 -                      if(eed->f2) EM_select_edge(eed, select);
 +                      co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0];
 +                      co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1];
 +                      co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2];                                        
 +                      
 +                      BLI_array_growone(edges);
-                       VECCOPY(edges[tot][0], co[0]);
-                       VECCOPY(edges[tot][1], co[1]);
++                      copy_v3_v3(edges[tot][0], co[0]);
++                      copy_v3_v3(edges[tot][1], co[1]);
 +                      tot++;
                }
        }
  
Simple merge