[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48136] trunk/blender/source/blender: make mask handles draw with an outline - when outline option is enabled.

Campbell Barton ideasman42 at gmail.com
Wed Jun 20 20:46:19 CEST 2012


Revision: 48136
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48136
Author:   campbellbarton
Date:     2012-06-20 18:46:18 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------
make mask handles draw with an outline - when outline option is enabled.

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp
    trunk/blender/source/blender/editors/mask/mask_draw.c
    trunk/blender/source/blender/editors/space_view3d/view3d_draw.c

Modified: trunk/blender/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp	2012-06-20 17:52:09 UTC (rev 48135)
+++ trunk/blender/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp	2012-06-20 18:46:18 UTC (rev 48136)
@@ -88,7 +88,7 @@
 	float *buffer = tile->getBuffer();
 	int size = tile->getWidth() * tile->getHeight();
 	int pixels = 0;
-	float sum;
+	float sum = 0.0f;
 	for (int i = 0, offset = 0; i < size; i++, offset += 4) {
 		if (buffer[offset + 3] > 0) {
 			pixels++;

Modified: trunk/blender/source/blender/editors/mask/mask_draw.c
===================================================================
--- trunk/blender/source/blender/editors/mask/mask_draw.c	2012-06-20 17:52:09 UTC (rev 48135)
+++ trunk/blender/source/blender/editors/mask/mask_draw.c	2012-06-20 18:46:18 UTC (rev 48136)
@@ -116,7 +116,8 @@
 #endif
 
 /* return non-zero if spline is selected */
-static void draw_spline_points(MaskLayer *masklay, MaskSpline *spline)
+static void draw_spline_points(MaskLayer *masklay, MaskSpline *spline,
+                               const char UNUSED(draw_flag), const char draw_type)
 {
 	const int is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0;
 	unsigned char rgb_spline[4];
@@ -188,8 +189,20 @@
 
 		/* draw handle segment */
 		if (has_handle) {
+
+			/* this could be split into its own loop */
+			if (draw_type == MASK_DT_OUTLINE) {
+				const unsigned char rgb_grey[4] = {0x60, 0x60, 0x60, 0xff};
+				glLineWidth(3);
+				glColor4ubv(rgb_grey);
+				glBegin(GL_LINES);
+				glVertex3fv(vert);
+				glVertex3fv(handle);
+				glEnd();
+				glLineWidth(1);
+			}
+
 			glColor3ubv(rgb_spline);
-
 			glBegin(GL_LINES);
 			glVertex3fv(vert);
 			glVertex3fv(handle);
@@ -415,7 +428,7 @@
 
 			if (!(masklay->restrictflag & MASK_RESTRICT_SELECT)) {
 				/* ...and then handles over the curve so they're nicely visible */
-				draw_spline_points(masklay, spline);
+				draw_spline_points(masklay, spline, draw_flag, draw_type);
 			}
 
 			/* show undeform for testing */
@@ -425,7 +438,7 @@
 				spline->points_deform = NULL;
 				draw_spline_curve(masklay, spline, draw_flag, draw_type, is_active, width, height);
 //				draw_spline_parents(masklay, spline);
-				draw_spline_points(masklay, spline);
+				draw_spline_points(masklay, spline, draw_flag, draw_type);
 				spline->points_deform = back;
 			}
 		}

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2012-06-20 17:52:09 UTC (rev 48135)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2012-06-20 18:46:18 UTC (rev 48136)
@@ -1589,6 +1589,11 @@
 				 * be dereferenced after usage. */
 				freeibuf = ibuf;
 			}
+			else {
+				/* perhaps when loading future files... */
+				BLI_assert(0);
+				copy_v2_fl(image_aspect, 1.0f);
+			}
 
 			if (ibuf == NULL)
 				continue;




More information about the Bf-blender-cvs mailing list