Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2008-11-11 06:12:31 +0300
committerMartin Poirier <theeth@yahoo.com>2008-11-11 06:12:31 +0300
commit8b32ad784b609cc131c498e6db7ec4a6bf784458 (patch)
tree42df07a7eba2ab535d80a8cf8e4564e31f9970c8 /source/blender/src
parenta00e63a542788ffe4e01515a09a1b55c087cb865 (diff)
Median center didn't use TD_NOCENTER properly, making it work incorrectly with hinge bones (and with chain rotations).
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/transform_generics.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c
index a1440b8cbce..2a91b66ad8e 100644
--- a/source/blender/src/transform_generics.c
+++ b/source/blender/src/transform_generics.c
@@ -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);