forked from bartvdbraak/blender
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.
This commit is contained in:
parent
2dcf23c327
commit
1ab71b2233
@ -1705,7 +1705,6 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
|
|||||||
median[4]= ve_median[4]-median[4];
|
median[4]= ve_median[4]-median[4];
|
||||||
|
|
||||||
if(ob->type==OB_MESH) {
|
if(ob->type==OB_MESH) {
|
||||||
float diffac= 1.0;
|
|
||||||
|
|
||||||
eve= em->verts.first;
|
eve= em->verts.first;
|
||||||
while(eve) {
|
while(eve) {
|
||||||
@ -1715,28 +1714,15 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
|
|||||||
eve= eve->next;
|
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) {
|
for(eed= em->edges.first; eed; eed= eed->next) {
|
||||||
if(eed->f & SELECT) {
|
if(eed->f & SELECT) {
|
||||||
eed->crease+= median[3];
|
/* ensure the median can be set to zero or one */
|
||||||
eed->crease= ve_median[3] + diffac*(eed->crease-ve_median[3]);
|
if(ve_median[3]==0.0f) eed->crease= 0.0f;
|
||||||
|
else if(ve_median[3]==1.0f) eed->crease= 1.0f;
|
||||||
CLAMP(eed->crease, 0.0, 1.0);
|
else {
|
||||||
|
eed->crease+= median[3];
|
||||||
|
CLAMP(eed->crease, 0.0, 1.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ void pose_calculate_path(Object *ob)
|
|||||||
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
|
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
|
||||||
if(pchan->bone && (pchan->bone->flag & BONE_SELECTED)) {
|
if(pchan->bone && (pchan->bone->flag & BONE_SELECTED)) {
|
||||||
if(arm->layer & pchan->bone->layer) {
|
if(arm->layer & pchan->bone->layer) {
|
||||||
pchan->pathlen= EFRA-SFRA;
|
pchan->pathlen= EFRA-SFRA+1;
|
||||||
if(pchan->path)
|
if(pchan->path)
|
||||||
MEM_freeN(pchan->path);
|
MEM_freeN(pchan->path);
|
||||||
pchan->path= MEM_callocN(3*pchan->pathlen*sizeof(float), "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;
|
cfra= CFRA;
|
||||||
for(CFRA=SFRA; CFRA<EFRA; CFRA++) {
|
for(CFRA=SFRA; CFRA<=EFRA; CFRA++) {
|
||||||
|
|
||||||
/* do all updates */
|
/* do all updates */
|
||||||
for(base= FIRSTBASE; base; base= base->next) {
|
for(base= FIRSTBASE; base; base= base->next) {
|
||||||
|
Loading…
Reference in New Issue
Block a user