diff options
author | Alexander Ewering <blender@instinctive.de> | 2003-09-10 20:26:21 +0400 |
---|---|---|
committer | Alexander Ewering <blender@instinctive.de> | 2003-09-10 20:26:21 +0400 |
commit | 8780ef0975a88db624b697f3c58111860cebe79c (patch) | |
tree | d8ff31ede294c7907d40407c1a66d850b652bad2 /source/blender | |
parent | 4646b046b69b61b54202396dcf373de08fe78cb7 (diff) |
The "extrude" operation now automatically sets newly created faces "smooth",
based on the assumption that if any of the faces attached to any of the
edges that have been extruded were "smooth", the result should also be.
(There is no other way to detect this, as edges don't have a "smooth" flag :-))
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/src/editmesh.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 9b7cc0e5cb0..69c94c4d842 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -2237,8 +2237,8 @@ short extrudeflag(short flag,short type) EditVert *eve, *v1, *v2, *v3, *v4, *nextve; EditEdge *eed, *e1, *e2, *e3, *e4, *nexted; - EditVlak *evl, *nextvl; - short sel=0, deloud= 0; + EditVlak *evl, *evl2, *nextvl; + short sel=0, deloud= 0, smooth= 0; if(G.obedit==0 || get_mesh(G.obedit)==0) return 0; @@ -2269,6 +2269,10 @@ short extrudeflag(short flag,short type) evl= G.edvl.first; while(evl) { evl->f= 0; + + if (evl->flag & ME_SMOOTH) { + if (vlakselectedOR(evl, 1)) smooth= 1; + } if(vlakselectedAND(evl, flag)) { e1= evl->e1; @@ -2369,10 +2373,9 @@ short extrudeflag(short flag,short type) if( (eed->f==1 || eed->f==2) ) { if(eed->f1==2) deloud=1; - /* that dir thing does work somewhat... */ - - if(eed->dir==1) addvlaklist(eed->v1, eed->v2, eed->v2->vn, eed->v1->vn, NULL); - else addvlaklist(eed->v2, eed->v1, eed->v1->vn, eed->v2->vn, NULL); + if(eed->dir==1) evl2= addvlaklist(eed->v1, eed->v2, eed->v2->vn, eed->v1->vn, NULL); + else evl2= addvlaklist(eed->v2, eed->v1, eed->v1->vn, eed->v2->vn, NULL); + if (smooth) evl2->flag |= ME_SMOOTH; } eed= nexted; @@ -2399,13 +2402,13 @@ short extrudeflag(short flag,short type) v3= evl->v3->vn; if(evl->v4) v4= evl->v4->vn; else v4= 0; - addvlaklist(v1, v2, v3, v4, evl); + evl2= addvlaklist(v1, v2, v3, v4, evl); if(deloud) { BLI_remlink(&G.edvl, evl); freevlak(evl); } - + if (smooth) evl2->flag |= ME_SMOOTH; } evl= nextvl; } |