[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37095] branches/soc-2011-pepper/source/ blender/editors/transform: Bugfix: "Time Slide" tool broken

Joshua Leung aligorith at gmail.com
Thu Jun 2 13:51:38 CEST 2011


Revision: 37095
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37095
Author:   aligorith
Date:     2011-06-02 11:51:38 +0000 (Thu, 02 Jun 2011)
Log Message:
-----------
Bugfix: "Time Slide" tool broken

Dunno how long this has been broken for (*), but the Time Slide
transform tool in DopeSheet no longer did anything most of the time.
It appeared to be be caused by some blotched indexing code from ages
ago. I've fixed this problem, as well as preventing the case where it
would also give errors when only a single key was selected.

(*) Does anyone actually use this tool? IIRC, this was added during
Orange, though I can't find the commit for this anymore or why it was
added. Probably it might be better to just let it go...

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/editors/transform/transform.c
    branches/soc-2011-pepper/source/blender/editors/transform/transform_conversions.c

Modified: branches/soc-2011-pepper/source/blender/editors/transform/transform.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/transform/transform.c	2011-06-02 11:22:22 UTC (rev 37094)
+++ branches/soc-2011-pepper/source/blender/editors/transform/transform.c	2011-06-02 11:51:38 UTC (rev 37095)
@@ -5801,8 +5801,8 @@
 	char str[200];
 
 	/* calculate mouse co-ordinates */
-	UI_view2d_region_to_view(v2d, mval[0], mval[0], &cval[0], &cval[1]);
-	UI_view2d_region_to_view(v2d, t->imval[0], t->imval[0], &sval[0], &sval[1]);
+	UI_view2d_region_to_view(v2d, mval[0], mval[1], &cval[0], &cval[1]);
+	UI_view2d_region_to_view(v2d, t->imval[0], t->imval[1], &sval[0], &sval[1]);
 
 	/* t->values[0] stores cval[0], which is the current mouse-pointer location (in frames) */
 	// XXX Need to be able to repeat this

Modified: branches/soc-2011-pepper/source/blender/editors/transform/transform_conversions.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/transform/transform_conversions.c	2011-06-02 11:22:22 UTC (rev 37094)
+++ branches/soc-2011-pepper/source/blender/editors/transform/transform_conversions.c	2011-06-02 11:51:38 UTC (rev 37095)
@@ -3129,13 +3129,22 @@
 	/* check if we're supposed to be setting minx/maxx for TimeSlide */
 	if (t->mode == TFM_TIME_SLIDE) {
 		float min=999999999.0f, max=-999999999.0f;
-		int i;
 		
-		td= (t->data + 1);
-		for (i=1; i < count; i+=3, td+=3) {
-			if (min > *(td->val)) min= *(td->val);
-			if (max < *(td->val)) max= *(td->val);
+		if (count > 1) {
+			/* search for min/max selected values to transform */
+			int i;
+			
+			td= t->data;
+			for (i=0; i < count; i++, td++) {
+				if (min > *(td->val)) min= *(td->val);
+				if (max < *(td->val)) max= *(td->val);
+			}
 		}
+		else {
+			/* just use the current frame ranges */
+			min = (float)PSFRA;
+			max = (float)PEFRA;
+		}
 		
 		/* minx/maxx values used by TimeSlide are stored as a
 		 * calloced 2-float array in t->customData. This gets freed




More information about the Bf-blender-cvs mailing list