Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-07-14 09:45:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-07-14 09:45:47 +0300
commit661f5a24d16191336b5067d554648ff0e58013f2 (patch)
treef1aa29414ed0fb5d7a57fcaf2490530c7f6caa8c /source/blender/draw/modes/paint_weight_mode.c
parent25dba156bec73cf05c87a59bbf28b401049643bb (diff)
DwM: Show face-mask overlay even with full-shading
Without this face selection would be used but invisible, display this over fully shaded surface.
Diffstat (limited to 'source/blender/draw/modes/paint_weight_mode.c')
-rw-r--r--source/blender/draw/modes/paint_weight_mode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c
index 6a46acd869b..809be5ef8b1 100644
--- a/source/blender/draw/modes/paint_weight_mode.c
+++ b/source/blender/draw/modes/paint_weight_mode.c
@@ -180,16 +180,19 @@ static void PAINT_WEIGHT_cache_populate(void *vedata, Object *ob)
if ((ob->type == OB_MESH) && (ob == draw_ctx->obact)) {
IDProperty *ces_mode_pw = BKE_layer_collection_engine_evaluated_get(ob, COLLECTION_MODE_PAINT_WEIGHT, "");
- bool use_wire = BKE_collection_engine_property_value_get_bool(ces_mode_pw, "use_wire");
const Mesh *me = ob->data;
+ const bool use_wire = BKE_collection_engine_property_value_get_bool(ces_mode_pw, "use_wire");
+ const bool use_surface = DRW_object_is_mode_shade(ob) == true;
const bool use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
const bool use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
struct Gwn_Batch *geom;
world_light = BKE_collection_engine_property_value_get_bool(ces_mode_pw, "use_shading") ? 0.5f : 1.0f;
- geom = DRW_cache_mesh_surface_weights_get(ob);
- DRW_shgroup_call_add(stl->g_data->fweights_shgrp, geom, ob->obmat);
+ if (use_surface) {
+ geom = DRW_cache_mesh_surface_weights_get(ob);
+ DRW_shgroup_call_add(stl->g_data->fweights_shgrp, geom, ob->obmat);
+ }
if (use_face_sel || use_wire) {
geom = DRW_cache_mesh_edges_paint_overlay_get(ob, use_wire, use_face_sel);