[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43399] trunk/blender/source/blender/ editors/space_clip/clip_draw.c: Fixed incorrect behavior of 2d stabilization preview in clip editor when proxied resolution is used

Sergey Sharybin sergey.vfx at gmail.com
Sun Jan 15 14:31:41 CET 2012


Revision: 43399
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43399
Author:   nazgul
Date:     2012-01-15 13:31:40 +0000 (Sun, 15 Jan 2012)
Log Message:
-----------
Fixed incorrect behavior of 2d stabilization preview in clip editor when proxied resolution is used

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_clip/clip_draw.c

Modified: trunk/blender/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_draw.c	2012-01-15 13:31:25 UTC (rev 43398)
+++ trunk/blender/source/blender/editors/space_clip/clip_draw.c	2012-01-15 13:31:40 UTC (rev 43399)
@@ -250,9 +250,9 @@
 
 		glBegin(GL_LINE_LOOP);
 			glVertex2f(0.0f, 0.0f);
-			glVertex2f(ibuf->x, 0.0f);
-			glVertex2f(ibuf->x, ibuf->y);
-			glVertex2f(0.0f, ibuf->y);
+			glVertex2f(width, 0.0f);
+			glVertex2f(width, height);
+			glVertex2f(0.0f, height);
 		glEnd();
 
 		glPopMatrix();
@@ -1259,14 +1259,24 @@
 		float smat[4][4], ismat[4][4];
 
 		ibuf= ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle);
-		BKE_tracking_stabdata_to_mat4(width, height, sc->loc, sc->scale, sc->angle, sc->stabmat);
 
-		unit_m4(smat);
-		smat[0][0]= 1.0f/width;
-		smat[1][1]= 1.0f/height;
-		invert_m4_m4(ismat, smat);
+		if(ibuf) {
+			float loc[2];
 
-		mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL);
+			if(width != ibuf->x)
+				mul_v2_v2fl(loc, sc->loc, (float)width / ibuf->x);
+			else
+				copy_v2_v2(loc, sc->loc);
+
+			BKE_tracking_stabdata_to_mat4(width, height, loc, sc->scale, sc->angle, sc->stabmat);
+
+			unit_m4(smat);
+			smat[0][0]= 1.0f/width;
+			smat[1][1]= 1.0f/height;
+			invert_m4_m4(ismat, smat);
+
+			mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL);
+		}
 	} else {
 		ibuf= ED_space_clip_get_buffer(sc);
 



More information about the Bf-blender-cvs mailing list