diff options
author | Roel Spruit <roel@spruitje.nl> | 2003-11-23 19:59:54 +0300 |
---|---|---|
committer | Roel Spruit <roel@spruitje.nl> | 2003-11-23 19:59:54 +0300 |
commit | 511b098c81913a8ce437ebed6c7f211dd9563f1b (patch) | |
tree | 79393613243860b0b8398e6c15cea3638014b7e5 /source/blender | |
parent | 90541541c3ad6e1e4a796b85e32a43ce60a8b885 (diff) |
Fixed a crash that would happen if the user tried to faceloop-cut starting at an edge that didn't belong to any face.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/src/editmesh.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 7b6b51dc775..654350d40b6 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -2128,7 +2128,7 @@ void loop(int mode) { EditEdge *start, *eed, *opposite,*currente, *oldstart; EditVlak *evl, *currentvl, *formervl; - short lastface=0, foundedge=0, c=0, tri=0, side=1, totface=0, searching=1, event=0; + short lastface=0, foundedge=0, c=0, tri=0, side=1, totface=0, searching=1, event=0, noface=1; if ((G.obedit==0) || (G.edvl.first==0)) return; @@ -2143,14 +2143,40 @@ void loop(int mode) /* reset variables */ start=eed=opposite=currente=0; evl=currentvl=formervl=0; - side=1; + side=noface=1; lastface=foundedge=c=tri=totface=0; /* Look for an edge close by */ start=findnearestedge(); + /* If the edge doesn't belong to a face, it's not a valid starting edge */ + if(start){ + start->f |= 16; + evl=G.edvl.first; + while(evl){ + if(evl->e1->f & 16){ + noface=0; + evl->e1->f &= ~16; + } + else if(evl->e2->f & 16){ + noface=0; + evl->e2->f &= ~16; + } + else if(evl->e3->f & 16){ + noface=0; + evl->e3->f &= ~16; + } + else if(evl->e4 && evl->e4->f & 16){ + noface=0; + evl->e4->f &= ~16; + } + + evl=evl->next; + } + } + /* Did we find anything that is selectable? */ - if(start && (oldstart==NULL || start!=oldstart)){ + if(start && !noface && (oldstart==NULL || start!=oldstart)){ /* If we stay in the neighbourhood of this edge, we don't have to recalculate the loop everytime*/ oldstart=start; |