From 1ab71b223340d1ea643027d4515c0cca7e0464e5 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 4 Nov 2006 10:09:05 +0000 Subject: [PATCH] Bugfix #5144 Nkey panel for creases median didn't work properly. Now it does as follows: - if set to 0 or 1 it applies that value to all creases - else it adds the diffference of median crease value and the button value Bugfix #5122 Paths drawing option for Poses now uses entire startframe-endframe range. Before it skipped the last frame for drawing. --- source/blender/src/drawview.c | 28 +++++++--------------------- source/blender/src/poseobject.c | 4 ++-- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 13669b02556..3ee670c646c 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -1705,7 +1705,6 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim) median[4]= ve_median[4]-median[4]; if(ob->type==OB_MESH) { - float diffac= 1.0; eve= em->verts.first; while(eve) { @@ -1715,28 +1714,15 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim) eve= eve->next; } - /* calculate the differences to squeeze a range smaller when values are close to 1 or 0 */ - /* this way you can edit a median value which is applied on clipped values :) */ - if(totedge>1) { - float max= 0.0; - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f & SELECT) { - if(max < ABS(eed->crease-ve_median[3])) max= ABS(eed->crease-ve_median[3]); - } - } - if(max>0.0) { - if(ve_median[3]> 0.5) diffac= (1.0-ve_median[3])/max; - else diffac= (ve_median[3])/max; - if(diffac>1.0) diffac= 1.0; - } - } - for(eed= em->edges.first; eed; eed= eed->next) { if(eed->f & SELECT) { - eed->crease+= median[3]; - eed->crease= ve_median[3] + diffac*(eed->crease-ve_median[3]); - - CLAMP(eed->crease, 0.0, 1.0); + /* ensure the median can be set to zero or one */ + if(ve_median[3]==0.0f) eed->crease= 0.0f; + else if(ve_median[3]==1.0f) eed->crease= 1.0f; + else { + eed->crease+= median[3]; + CLAMP(eed->crease, 0.0, 1.0); + } } } diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 6cc4a986cc1..cce2e3705a3 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -215,7 +215,7 @@ void pose_calculate_path(Object *ob) for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { if(pchan->bone && (pchan->bone->flag & BONE_SELECTED)) { if(arm->layer & pchan->bone->layer) { - pchan->pathlen= EFRA-SFRA; + pchan->pathlen= EFRA-SFRA+1; if(pchan->path) MEM_freeN(pchan->path); pchan->path= MEM_callocN(3*pchan->pathlen*sizeof(float), "pchan path"); @@ -224,7 +224,7 @@ void pose_calculate_path(Object *ob) } cfra= CFRA; - for(CFRA=SFRA; CFRAnext) {