[Bf-blender-cvs] [4a2c58e0772] blender2.8: Outlines: Don't draw Xray mode outlines in material or render mode

Clément Foucault noreply at git.blender.org
Sat Jun 16 23:28:29 CEST 2018


Commit: 4a2c58e0772fe026b2dbe6488672758e6dc439c4
Author: Clément Foucault
Date:   Sat Jun 16 21:05:24 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4a2c58e0772fe026b2dbe6488672758e6dc439c4

Outlines: Don't draw Xray mode outlines in material or render mode

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

M	source/blender/draw/modes/object_mode.c

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

diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index f6fc58557f2..146e990500c 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -874,7 +874,8 @@ static void OBJECT_cache_init(void *vedata)
 	DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
 	OBJECT_PrivateData *g_data;
 	const DRWContextState *draw_ctx = DRW_context_state_get();
-	const bool xray_enabled = ((draw_ctx->v3d->shading.flag & V3D_SHADING_XRAY) != 0);
+	const bool xray_enabled = ((draw_ctx->v3d->shading.flag & V3D_SHADING_XRAY) != 0) &&
+	                           (draw_ctx->v3d->drawtype < OB_MATERIAL);
 	/* TODO : use dpi setting for enabling the second pass */
 	const bool do_outline_expand = false;
 
@@ -2110,7 +2111,9 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
 	if (do_outlines) {
 		if ((ob != draw_ctx->object_edit) && !((ob == draw_ctx->obact) && (draw_ctx->object_mode & OB_MODE_ALL_PAINT))) {
 			struct Gwn_Batch *geom;
-			if (v3d->shading.flag & V3D_SHADING_XRAY) {
+			const bool xray_enabled = ((v3d->shading.flag & V3D_SHADING_XRAY) != 0) &&
+			                           (v3d->drawtype < OB_MATERIAL);
+			if (xray_enabled) {
 				geom = DRW_cache_object_edge_detection_get(ob, NULL);
 			}
 			else {



More information about the Bf-blender-cvs mailing list