From 1ae3e3efc1dcddba53190f0e9eae92227a5b01c7 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 23 Sep 2004 22:54:18 +0000 Subject: [PATCH] Fix for loopcut, didn't work after reconstruct... --- source/blender/src/editmesh_loop.c | 26 +++++++++++++++----------- source/blender/src/editmesh_tools.c | 12 +++++++----- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/source/blender/src/editmesh_loop.c b/source/blender/src/editmesh_loop.c index 6fcec5a9b74..e7350f8384f 100644 --- a/source/blender/src/editmesh_loop.c +++ b/source/blender/src/editmesh_loop.c @@ -1770,17 +1770,21 @@ void loopoperations(char mode) if(cut){ /* Now that we have selected a cut %, mark the edges for cutting. */ if(!inset){ - for(eed = em->edges.first; eed; eed=eed->next){ - if(percentcut == 1.0) - percentcut = 0.9999; - else if(percentcut == 0.0) - percentcut = 0.0001; - if(eed->f & 8){ - if(eed->f & 32)/* Need to offset by a const. (0.5/32768) for consistant roundoff */ - eed->f1 = 32768*(1.0-percentcut - 0.0000153); - else - eed->f1 = 32768*(percentcut + 0.0000153); - } + + for(eed = em->edges.first; eed; eed=eed->next){ + if(percentcut == 1.0) + percentcut = 0.9999; + else if(percentcut == 0.0) + percentcut = 0.0001; + if(eed->f & 8){ + if(eed->f & 32)/* Need to offset by a const. (0.5/32768) for consistant roundoff */ + eed->f1 = 32768*(1.0-percentcut - 0.0000153); + else + eed->f1 = 32768*(percentcut + 0.0000153); + } + + /* because of hack in subdivideflag (ton) */ + eed->f2= eed->f; } } /*-------------------------------------*/ diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 5c6f0c74681..d1f1be2c26c 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -1325,11 +1325,13 @@ void subdivideflag(int flag, float rad, int beauty) } /* edgeflags */ - eed= em->edges.first; - while((eed) && !(beauty & B_KNIFE)) { - if( (eed->v1->f & flag) && (eed->v2->f & flag) ) eed->f2= flag; - else eed->f2= 0; - eed= eed->next; + if((beauty & B_KNIFE)==0) { // knife option sets own flags + eed= em->edges.first; + while(eed) { + if( (eed->v1->f & flag) && (eed->v2->f & flag) ) eed->f2= flag; + else eed->f2= 0; + eed= eed->next; + } } /* if beauty: test for area and clear edge flags of 'ugly' edges */