Particle combing didn't always respond as expected. The combed effect was 
depending on the center of object in view, instead of on the center of 
selected hairs. That made combing in certain close ups impossible.

Same was actually true for transform tools for hairs!

And even worse - there was an optimize break in calculating center
which wasn't true even. Causing centers for transform to fail similar
in other cases.
This commit is contained in:
Ton Roosendaal 2012-12-21 17:47:50 +00:00
parent 4d8f340d3e
commit c9b8839237
2 changed files with 7 additions and 16 deletions

@ -3476,11 +3476,16 @@ static int brush_edit_init(bContext *C, wmOperator *op)
PTCacheEdit *edit= PE_get_current(scene, ob);
ARegion *ar= CTX_wm_region(C);
BrushEdit *bedit;
float min[3], max[3];
if (pset->brushtype < 0)
return 0;
initgrabz(ar->regiondata, ob->obmat[3][0], ob->obmat[3][1], ob->obmat[3][2]);
/* set the 'distance factor' for grabbing (used in comb etc) */
INIT_MINMAX(min, max);
PE_minmax(scene, min, max);
mid_v3_v3v3(min, min, max);
initgrabz(ar->regiondata, min[0], min[1], min[2]);
bedit= MEM_callocN(sizeof(BrushEdit), "BrushEdit");
bedit->first= 1;

@ -1529,13 +1529,6 @@ void calculateCenterMedian(TransInfo *t)
total++;
}
}
else {
/*
* All the selected elements are at the head of the array
* which means we can stop when it finds unselected data
*/
break;
}
}
if (i)
mul_v3_fl(partial, 1.0f / total);
@ -1555,13 +1548,6 @@ void calculateCenterBound(TransInfo *t)
if (!(t->data[i].flag & TD_NOCENTER))
minmax_v3v3_v3(min, max, t->data[i].center);
}
else {
/*
* All the selected elements are at the head of the array
* which means we can stop when it finds unselected data
*/
break;
}
}
else {
copy_v3_v3(max, t->data[i].center);