[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49946] branches/soc-2011-tomato: svn merge ^/trunk/blender -r49939:49945

Campbell Barton ideasman42 at gmail.com
Fri Aug 17 10:25:24 CEST 2012


Revision: 49946
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49946
Author:   campbellbarton
Date:     2012-08-17 08:25:23 +0000 (Fri, 17 Aug 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r49939:49945

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49939

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp
    branches/soc-2011-tomato/source/blender/editors/space_view3d/drawobject.c

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49939
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49945

Modified: branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp	2012-08-16 18:37:30 UTC (rev 49945)
+++ branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp	2012-08-17 08:25:23 UTC (rev 49946)
@@ -283,7 +283,14 @@
 	// Use a different radius based on interpolation switch, just enough to anti-alias when interpolation is off,
 	// and slightly larger to make result a bit smoother than bilinear interpolation when interpolation is on
 	// (minimum values: const float rmin = intpol ? 1.f : 0.5f;)
+
+	/* note: 0.765625f is too sharp, 1.0 will not blur with an exact pixel sample
+	 * useful to avoid blurring when there is no distortion */
+#if 0
 	const float rmin = ((sampler != COM_PS_NEAREST) ? 1.5625f : 0.765625f) / ff2;
+#else
+	const float rmin = ((sampler != COM_PS_NEAREST) ? 1.5625f : 1.0f     ) / ff2;
+#endif
 	imp2radangle(A, B, C, F, &a, &b, &th, &ecc);
 	if ((b2 = b * b) < rmin) {
 		if ((a2 = a * a) < rmin) {


Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49939
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49945


Property changes on: branches/soc-2011-tomato/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-49939
   + /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-49945

Modified: branches/soc-2011-tomato/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_view3d/drawobject.c	2012-08-16 18:37:30 UTC (rev 49945)
+++ branches/soc-2011-tomato/source/blender/editors/space_view3d/drawobject.c	2012-08-17 08:25:23 UTC (rev 49946)
@@ -193,6 +193,18 @@
 static void draw_empty_sphere(float size);
 static void draw_empty_cone(float size);
 
+static void ob_wire_color_blend_theme_id(const unsigned char ob_wire_col[4], const int theme_id, float fac)
+{
+	float col_bg[3], col[3];
+	float col_wire[3] = {ob_wire_col[0] / 255.0f,
+	                     ob_wire_col[1] / 255.0f,
+	                     ob_wire_col[2] / 255.0f};
+
+	UI_GetThemeColor3fv(theme_id, col_bg);
+	interp_v3_v3v3(col, col_bg, col_wire, fac);
+	glColor3fv(col);
+}
+
 /* this condition has been made more complex since editmode can draw textures */
 static int check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
 {
@@ -653,7 +665,7 @@
 
 
 /* Function to draw an Image on a empty Object */
-static void draw_empty_image(Object *ob)
+static void draw_empty_image(Object *ob, const short dflag, const unsigned char ob_wire_col[4])
 {
 	Image *ima = (Image *)ob->data;
 	ImBuf *ibuf = ima ? BKE_image_get_ibuf(ima, NULL) : NULL;
@@ -726,15 +738,17 @@
 		glDisable(GL_BLEND);
 	}
 
-	UI_ThemeColor((ob->flag & SELECT) ? TH_SELECT : TH_WIRE);
+	if ((dflag & DRAW_CONSTCOLOR) == 0) {
+		glColor3ubv(ob_wire_col);
 
-	/* Calculate the outline vertex positions */
-	glBegin(GL_LINE_LOOP);
-	glVertex2f(ofs_x, ofs_y);
-	glVertex2f(ofs_x + ima_x, ofs_y);
-	glVertex2f(ofs_x + ima_x, ofs_y + ima_y);
-	glVertex2f(ofs_x, ofs_y + ima_y);
-	glEnd();
+		/* Calculate the outline vertex positions */
+		glBegin(GL_LINE_LOOP);
+		glVertex2f(ofs_x, ofs_y);
+		glVertex2f(ofs_x + ima_x, ofs_y);
+		glVertex2f(ofs_x + ima_x, ofs_y + ima_y);
+		glVertex2f(ofs_x, ofs_y + ima_y);
+		glEnd();
+	}
 
 	/* Reset GL settings */
 	glMatrixMode(GL_MODELVIEW);
@@ -3354,7 +3368,7 @@
 }
 
 static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, Base *base,
-                            const short dt, const short dflag)
+                            const short dt, const unsigned char ob_wire_col[4], const short dflag)
 {
 	Object *ob = base->object;
 	Mesh *me = ob->data;
@@ -3428,13 +3442,12 @@
 		}
 
 		if (!(draw_flags & DRAW_FACE_SELECT)) {
-			if (base->flag & SELECT)
-				UI_ThemeColor(is_obact ? TH_ACTIVE : TH_SELECT);
-			else
-				UI_ThemeColor(TH_WIRE);
-
-			if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
+			if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
+				if ((dflag & DRAW_CONSTCOLOR) == 0) {
+					glColor3ubv(ob_wire_col);
+				}
 				dm->drawLooseEdges(dm);
+			}
 		}
 	}
 	else if (dt == OB_SOLID) {
@@ -3518,14 +3531,12 @@
 
 			glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
 
-			if (base->flag & SELECT) {
-				UI_ThemeColor(is_obact ? TH_ACTIVE : TH_SELECT);
-			}
-			else {
-				UI_ThemeColor(TH_WIRE);
-			}
-			if (!ob->sculpt && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
+			if (!ob->sculpt && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
+				if ((dflag & DRAW_CONSTCOLOR) == 0) {
+					glColor3ubv(ob_wire_col);
+				}
 				dm->drawLooseEdges(dm);
+			}
 		}
 	}
 	else if (dt == OB_PAINT) {
@@ -3534,42 +3545,22 @@
 		/* since we already draw wire as wp guide, don't draw over the top */
 		draw_wire = OBDRAW_WIRE_OFF;
 	}
-	
-	/* set default draw color back for wire or for draw-extra later on */
-	if (dt != OB_WIRE) {
-		if (base->flag & SELECT) {
-			if (is_obact && ob->flag & OB_FROMGROUP)
-				UI_ThemeColor(TH_GROUP_ACTIVE);
-			else if (ob->flag & OB_FROMGROUP)
-				UI_ThemeColorShade(TH_GROUP_ACTIVE, -16);
-			else if (dflag != DRAW_CONSTCOLOR)
-				UI_ThemeColor(is_obact ? TH_ACTIVE : TH_SELECT);
-			else
-				glColor3ub(80, 80, 80);
-		}
-		else {
-			if (ob->flag & OB_FROMGROUP)
-				UI_ThemeColor(TH_GROUP);
-			else {
-				if (ob->dtx & OB_DRAWWIRE && dflag == DRAW_CONSTCOLOR)
-					glColor3ub(80, 80, 80);
-				else
-					UI_ThemeColor(TH_WIRE);
-			}
-		}
-	}
-	if (draw_wire != OBDRAW_WIRE_OFF) {
 
+	if ((draw_wire != OBDRAW_WIRE_OFF) &&  /* draw extra wire */
+	    /* when overriding with render only, don't bother  */
+	    (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_SOLID) == 0))
+	{
 		/* When using wireframe object draw in particle edit mode
 		 * the mesh gets in the way of seeing the particles, fade the wire color
 		 * with the background. */
-		if (is_obact && (ob->mode & OB_MODE_PARTICLE_EDIT)) {
-			float col_wire[4], col_bg[4], col[3];
 
-			UI_GetThemeColor3fv(TH_BACK, col_bg);
-			glGetFloatv(GL_CURRENT_COLOR, col_wire);
-			interp_v3_v3v3(col, col_bg, col_wire, 0.15);
-			glColor3fv(col);
+		if ((dflag & DRAW_CONSTCOLOR) == 0) {
+			if (is_obact && (ob->mode & OB_MODE_PARTICLE_EDIT)) {
+				ob_wire_color_blend_theme_id(ob_wire_col, TH_BACK, 0.15f);
+			}
+			else {
+				glColor3ubv(ob_wire_col);
+			}
 		}
 
 		/* If drawing wire and drawtype is not OB_WIRE then we are
@@ -3586,8 +3577,7 @@
 			glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
 		}
 		
-		if (((v3d->flag2 & V3D_RENDER_OVERRIDE) && v3d->drawtype >= OB_SOLID) == 0)
-			dm->drawEdges(dm, (dt == OB_WIRE || totface == 0), me->drawflag & ME_ALLEDGES);
+		dm->drawEdges(dm, (dt == OB_WIRE || totface == 0), me->drawflag & ME_ALLEDGES);
 
 		if (dt != OB_WIRE && (draw_wire == OBDRAW_WIRE_ON_DEPTH)) {
 			glDepthMask(1);
@@ -3609,7 +3599,7 @@
 
 /* returns 1 if nothing was drawn, for detecting to draw an object center */
 static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, Base *base,
-                            const short dt, const short dflag)
+                            const short dt, const unsigned char ob_wire_col[4], const short dflag)
 {
 	Object *ob = base->object;
 	Object *obedit = scene->obedit;
@@ -3673,7 +3663,7 @@
 				                           (check_alpha) ? &do_alpha_after : NULL);
 			}
 
-			draw_mesh_fancy(scene, ar, v3d, rv3d, base, dt, dflag);
+			draw_mesh_fancy(scene, ar, v3d, rv3d, base, dt, ob_wire_col, dflag);
 
 			GPU_end_object_materials();
 			
@@ -5913,9 +5903,9 @@
 	glVertex3f(cur[0], cur[1] - radius, cur[2]);
 	glEnd();
 }

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list