[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54441] trunk/blender/source/blender/ blenkernel/intern/sequencer.c: [#34013] [video sequence editor] Offset and crop of strips are wrong

Peter Schlaile peter at schlaile.de
Sun Feb 10 22:01:30 CET 2013


Revision: 54441
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54441
Author:   schlaile
Date:     2013-02-10 21:01:30 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
[#34013] [video sequence editor] Offset and crop of strips are wrong

Applied patch by jehan after confirming the issue.

Thanks for the patch!

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/sequencer.c

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c	2013-02-10 20:47:44 UTC (rev 54440)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c	2013-02-10 21:01:30 UTC (rev 54441)
@@ -1820,8 +1820,6 @@
 		StripCrop c = {0};
 		StripTransform t = {0};
 		int sx, sy, dx, dy;
-		double xscale = 1.0;
-		double yscale = 1.0;
 
 		if (is_proxy_image) {
 			double f = seq_rendersize_to_scale_factor(context.preview_render_size);
@@ -1838,21 +1836,23 @@
 			t = *seq->strip->transform;
 		}
 
-		xscale = context.scene->r.xsch ? ((double)context.rectx / (double)context.scene->r.xsch) : 1.0;
-		yscale = context.scene->r.ysch ? ((double)context.recty / (double)context.scene->r.ysch) : 1.0;
+		if (is_preprocessed) {
+			double xscale = context.scene->r.xsch ? ((double)context.rectx / (double)context.scene->r.xsch) : 1.0;
+			double yscale = context.scene->r.ysch ? ((double)context.recty / (double)context.scene->r.ysch) : 1.0;
+			if (seq->flag & SEQ_USE_TRANSFORM) {
+				t.xofs *= xscale;
+				t.yofs *= yscale;
+			}
+			if (seq->flag & SEQ_USE_CROP) {
+				c.left *= xscale;
+				c.right *= xscale;
+				c.top *= yscale;
+				c.bottom *= yscale;
+			}
+		}
 
-		xscale /= (double)context.rectx / (double)ibuf->x;
-		yscale /= (double)context.recty / (double)ibuf->y;
-
-		c.left *= xscale; c.right *= xscale;
-		c.top *= yscale; c.bottom *= yscale;
-
-		t.xofs *= xscale; t.yofs *= yscale;
-
 		sx = ibuf->x - c.left - c.right;
 		sy = ibuf->y - c.top - c.bottom;
-		dx = sx;
-		dy = sy;
 
 		if (seq->flag & SEQ_USE_TRANSFORM) {
 			if (is_preprocessed) {
@@ -1864,6 +1864,10 @@
 				dy = context.scene->r.ysch;
 			}
 		}
+		else {
+			dx = sx;
+			dy = sy;
+		}
 
 		if (c.top  + c.bottom >= ibuf->y ||
 		    c.left + c.right  >= ibuf->x ||




More information about the Bf-blender-cvs mailing list