forked from bartvdbraak/blender
Median center didn't use TD_NOCENTER properly, making it work incorrectly with hinge bones (and with chain rotations).
This commit is contained in:
parent
a00e63a542
commit
8b32ad784b
@ -876,12 +876,16 @@ void calculateCenterCursor2D(TransInfo *t)
|
||||
void calculateCenterMedian(TransInfo *t)
|
||||
{
|
||||
float partial[3] = {0.0f, 0.0f, 0.0f};
|
||||
int total = 0;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < t->total; i++) {
|
||||
if (t->data[i].flag & TD_SELECTED) {
|
||||
if (!(t->data[i].flag & TD_NOCENTER))
|
||||
{
|
||||
VecAddf(partial, partial, t->data[i].center);
|
||||
total++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
@ -892,7 +896,7 @@ void calculateCenterMedian(TransInfo *t)
|
||||
}
|
||||
}
|
||||
if(i)
|
||||
VecMulf(partial, 1.0f / i);
|
||||
VecMulf(partial, 1.0f / total);
|
||||
VECCOPY(t->center, partial);
|
||||
|
||||
calculateCenter2D(t);
|
||||
|
Loading…
Reference in New Issue
Block a user