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-05-17 10:27:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-05-17 10:27:20 +0300
commitd41f98406f5d397e4870c9151a8674b67a062d2e (patch)
tree69f725ad953d22ef0e88af716766de571dd5d0e7 /source/blender/draw/modes/paint_weight_mode.c
parente74177d3b17fc9e1c51af1794e4e120906d852a5 (diff)
DWM: minor changes to face-flag use
Diffstat (limited to 'source/blender/draw/modes/paint_weight_mode.c')
-rw-r--r--source/blender/draw/modes/paint_weight_mode.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c
index 7bf61b0a133..7139d634686 100644
--- a/source/blender/draw/modes/paint_weight_mode.c
+++ b/source/blender/draw/modes/paint_weight_mode.c
@@ -173,7 +173,9 @@ 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");
- char flag = ((Mesh *)ob->data)->editflag;
+ const Mesh *me = ob->data;
+ 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 Batch *geom;
world_light = BKE_collection_engine_property_value_get_bool(ces_mode_pw, "use_shading") ? 0.5f : 1.0f;
@@ -181,17 +183,17 @@ static void PAINT_WEIGHT_cache_populate(void *vedata, Object *ob)
geom = DRW_cache_mesh_surface_weights_get(ob);
DRW_shgroup_call_add(stl->g_data->fweights_shgrp, geom, ob->obmat);
- if (flag & ME_EDIT_PAINT_FACE_SEL || use_wire) {
- geom = DRW_cache_mesh_edges_paint_overlay_get(ob, use_wire, flag & ME_EDIT_PAINT_FACE_SEL);
+ if (use_face_sel || use_wire) {
+ geom = DRW_cache_mesh_edges_paint_overlay_get(ob, use_wire, use_face_sel);
DRW_shgroup_call_add(stl->g_data->lwire_shgrp, geom, ob->obmat);
}
- if (flag & ME_EDIT_PAINT_FACE_SEL) {
+ if (use_face_sel) {
geom = DRW_cache_mesh_faces_weight_overlay_get(ob);
DRW_shgroup_call_add(stl->g_data->face_shgrp, geom, ob->obmat);
}
- if (flag & ME_EDIT_PAINT_VERT_SEL) {
+ if (use_vert_sel) {
geom = DRW_cache_mesh_verts_weight_overlay_get(ob);
DRW_shgroup_call_add(stl->g_data->vert_shgrp, geom, ob->obmat);
}