[Bf-blender-cvs] [49bf43e63ac] greasepencil-object: GP: Fix orange lines in primitives

Antonioya noreply at git.blender.org
Tue Dec 11 10:18:47 CET 2018


Commit: 49bf43e63acd09d1995826a9f85985c278445ce6
Author: Antonioya
Date:   Tue Dec 11 10:18:37 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB49bf43e63acd09d1995826a9f85985c278445ce6

GP: Fix orange lines in primitives

The orange lines must be on top of the stroke. Before, the current stroke was drawn in Front, but since we have speed painting functions, we can draw on back.

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

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

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 3f2e10a7692..590ae825371 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -434,7 +434,7 @@ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(
 		DRW_shgroup_uniform_int(grp, "xraymode", (const int *) &gpd->xray_mode, 1);
 	}
 	else {
-		/* for drawing always on front */
+		/* for drawing always on predefined z-depth */
 		DRW_shgroup_uniform_int(grp, "xraymode", &stl->storage->xray, 1);
 	}
 
@@ -527,7 +527,7 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(
 		DRW_shgroup_uniform_int(grp, "xraymode", (const int *)&gpd->xray_mode, 1);
 	}
 	else {
-		/* for drawing always on front */
+		/* for drawing always on on predefined z-depth */
 		DRW_shgroup_uniform_int(grp, "xraymode", &stl->storage->xray, 1);
 	}
 
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 483d6a80991..11da8f8cffe 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -312,7 +312,7 @@ void GPENCIL_cache_init(void *vedata)
 	if (!stl->g_data) {
 		/* Alloc transient pointers */
 		stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
-		stl->storage->xray = GP_XRAY_FRONT; /* used for drawing */
+		stl->storage->xray = GP_XRAY_BACK; /* used for drawing */
 		stl->storage->stroke_style = GP_STYLE_STROKE_STYLE_SOLID; /* used for drawing */
 	}
 	stl->storage->tonemapping = 0;



More information about the Bf-blender-cvs mailing list