[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45462] trunk/blender/source/blender: Disabling color channels for float images in clip editor now works fine.

Sergey Sharybin sergey.vfx at gmail.com
Sat Apr 7 18:59:06 CEST 2012


Revision: 45462
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45462
Author:   nazgul
Date:     2012-04-07 16:59:06 +0000 (Sat, 07 Apr 2012)
Log Message:
-----------
Disabling color channels for float images in clip editor now works fine.

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

Modified: trunk/blender/source/blender/blenkernel/intern/tracking.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/tracking.c	2012-04-07 16:37:55 UTC (rev 45461)
+++ trunk/blender/source/blender/blenkernel/intern/tracking.c	2012-04-07 16:59:06 UTC (rev 45462)
@@ -1125,6 +1125,9 @@
 			}
 		}
 	}
+
+	if (ibuf->rect_float)
+		ibuf->userflags |= IB_RECT_INVALID;
 }
 
 static void disable_imbuf_channels(ImBuf *ibuf, MovieTrackingTrack *track, int grayscale)

Modified: trunk/blender/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_draw.c	2012-04-07 16:37:55 UTC (rev 45461)
+++ trunk/blender/source/blender/editors/space_clip/clip_draw.c	2012-04-07 16:59:06 UTC (rev 45462)
@@ -216,6 +216,13 @@
 		ED_region_info_draw(ar, str, block, 0.6f);
 }
 
+static void verify_buffer_float(ImBuf *ibuf)
+{
+	if (ibuf->rect_float && (ibuf->rect == NULL || (ibuf->userflags & IB_RECT_INVALID))) {
+		IMB_rect_from_float(ibuf);
+	}
+}
+
 static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf,
                                   int width, int height, float zoomx, float zoomy)
 {
@@ -233,9 +240,7 @@
 		glRectf(x, y, x + zoomx * width, y + zoomy * height);
 	}
 	else {
-		if (ibuf->rect_float && !ibuf->rect) {
-			IMB_rect_from_float(ibuf);
-		}
+		verify_buffer_float(ibuf);
 
 		if (ibuf->rect)
 			glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);




More information about the Bf-blender-cvs mailing list