[Bf-blender-cvs] [2cd478cf197] master: GPencil: Rename variable name and add alpha to outline

Antonioya noreply at git.blender.org
Thu Feb 28 17:15:12 CET 2019


Commit: 2cd478cf1971aa27c46dbe683354c3f2165dc548
Author: Antonioya
Date:   Thu Feb 28 16:11:30 2019 +0100
Branches: master
https://developer.blender.org/rB2cd478cf1971aa27c46dbe683354c3f2165dc548

GPencil: Rename variable name and add alpha to outline

The outline now has some alpha to be more consistent with other Blender areas.

===================================================================

M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/gpencil/gpencil_engine.h

===================================================================

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 0903faf6a75..d9ee2b26b50 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -457,7 +457,7 @@ void GPENCIL_cache_init(void *vedata)
 		DRW_shgroup_uniform_texture_ref(mix_shgrp, "strokeColor", &e_data.input_color_tx);
 		DRW_shgroup_uniform_texture_ref(mix_shgrp, "strokeDepth", &e_data.input_depth_tx);
 		DRW_shgroup_uniform_int(mix_shgrp, "tonemapping", &stl->storage->tonemapping, 1);
-		DRW_shgroup_uniform_int(mix_shgrp, "do_select", &stl->storage->do_select, 1);
+		DRW_shgroup_uniform_int(mix_shgrp, "do_select", &stl->storage->do_select_outline, 1);
 		DRW_shgroup_uniform_vec4(mix_shgrp, "select_color", stl->storage->select_color, 1);
 
 		/* mix pass no blend used to copy between passes. A separated pass is required
@@ -474,7 +474,7 @@ void GPENCIL_cache_init(void *vedata)
 		DRW_shgroup_uniform_texture_ref(mix_shgrp_noblend, "strokeColor", &e_data.input_color_tx);
 		DRW_shgroup_uniform_texture_ref(mix_shgrp_noblend, "strokeDepth", &e_data.input_depth_tx);
 		DRW_shgroup_uniform_int(mix_shgrp_noblend, "tonemapping", &stl->storage->tonemapping, 1);
-		DRW_shgroup_uniform_int(mix_shgrp_noblend, "do_select", &stl->storage->do_select, 1);
+		DRW_shgroup_uniform_int(mix_shgrp_noblend, "do_select", &stl->storage->do_select_outline, 1);
 		DRW_shgroup_uniform_vec4(mix_shgrp_noblend, "select_color", stl->storage->select_color, 1);
 
 		/* Painting session pass (used only to speedup while the user is drawing )
@@ -985,7 +985,7 @@ void GPENCIL_draw_scene(void *ved)
 				stl->storage->tonemapping = stl->storage->is_render ? 1 : 0;
 
 				/* active select flag and selection color */
-				stl->storage->do_select = ((overlay) &&
+				stl->storage->do_select_outline = ((overlay) &&
 										   (ob->base_flag & BASE_SELECTED) &&
 										   (ob->mode == OB_MODE_OBJECT) &&
 										   (!is_render) && (!playing) &&
@@ -993,16 +993,16 @@ void GPENCIL_draw_scene(void *ved)
 
 				/* if active object is not object mode, disable for all objects */
 				if ((draw_ctx->obact) && (draw_ctx->obact->mode != OB_MODE_OBJECT)) {
-					stl->storage->do_select = 0;
+					stl->storage->do_select_outline = 0;
 				}
-				UI_GetThemeColor4fv((ob == draw_ctx->obact) ? TH_ACTIVE : TH_SELECT,
-									stl->storage->select_color);
+				UI_GetThemeColorShadeAlpha4fv((ob == draw_ctx->obact) ? TH_ACTIVE : TH_SELECT, 0, -40,
+											stl->storage->select_color);
 
 				/* draw mix pass */
 				DRW_draw_pass(psl->mix_pass);
 
 				/* disable select flag */
-				stl->storage->do_select = 0;
+				stl->storage->do_select_outline = 0;
 
 				/* prepare for fast drawing */
 				if (!is_render) {
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index a27f2968487..1b92f599246 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -146,7 +146,7 @@ typedef struct GPENCIL_Storage {
 	const float *pixsize;
 	float render_pixsize;
 	int tonemapping;
-	int do_select;
+	int do_select_outline;
 	float select_color[4];
 	short multisamples;



More information about the Bf-blender-cvs mailing list