[Bf-blender-cvs] [aed97c9] master: Fix bug with autonormalization and transform (after own range commit).

Antony Riakiotakis noreply at git.blender.org
Mon Apr 13 18:37:32 CEST 2015


Commit: aed97c9efb3c7c035031bf70edd07f2d81e4e3e2
Author: Antony Riakiotakis
Date:   Mon Apr 13 18:37:15 2015 +0200
Branches: master
https://developer.blender.org/rBaed97c9efb3c7c035031bf70edd07f2d81e4e3e2

Fix bug with autonormalization and transform (after own range commit).

Transforming the center after transforming a handle would continuously
flush an extra offset to the handles.

Also use normalization range of -1.0 to 1.0 instead of -0.5 to 0.5 (not
really important, just for better comparisons)

===================================================================

M	source/blender/editors/animation/anim_draw.c
M	source/blender/editors/transform/transform_conversions.c

===================================================================

diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 6d0086c..54d371d 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -330,7 +330,7 @@ static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, flo
 		range = max_coord - min_coord;
 
 		if (range > FLT_EPSILON) {
-			factor = 1.0f / range;
+			factor = 2.0f / range;
 		}
 		offset = -min_coord - range / 2.0f;
 	}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index f216855..5750ba4 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -4549,12 +4549,12 @@ void flushTransGraphData(TransInfo *t)
 		
 		if ((td->flag & TD_MOVEHANDLE1) && td2d->h1) {
 			td2d->h1[0] = td2d->ih1[0] + td->loc[0] - td->iloc[0];
-			td2d->h1[1] = td2d->ih1[1] + (td->loc[1] - td->iloc[1]) * inv_unit_scale - tdg->offset;
+			td2d->h1[1] = td2d->ih1[1] + (td->loc[1] - td->iloc[1]) * inv_unit_scale;
 		}
 		
 		if ((td->flag & TD_MOVEHANDLE2) && td2d->h2) {
 			td2d->h2[0] = td2d->ih2[0] + td->loc[0] - td->iloc[0];
-			td2d->h2[1] = td2d->ih2[1] + (td->loc[1] - td->iloc[1]) * inv_unit_scale - tdg->offset;
+			td2d->h2[1] = td2d->ih2[1] + (td->loc[1] - td->iloc[1]) * inv_unit_scale;
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list