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>2016-02-22 17:22:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-02-22 17:24:42 +0300
commite3f997d47ffe5a717e3e24f8fc17e94d285d65f2 (patch)
tree4c54c8a8b0d83a5fee890634146fdfa3eb60409c
parent7a74738914a66e9dafd0679b7fb7b8359e7d8dd6 (diff)
Fix T47517: "Show Weights" edit-mode fails
Don't use materials when showing weight colors.
-rw-r--r--source/blender/editors/space_view3d/drawobject.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 871faa3f7b3..a10b8c72099 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -4248,20 +4248,26 @@ static bool draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3
scene, ob, em, scene->customdata_mask,
&finalDM);
+ const bool use_material = ((me->drawflag & ME_DRAWEIGHT) == 0);
+
DM_update_materials(finalDM, ob);
if (cageDM != finalDM) {
DM_update_materials(cageDM, ob);
}
- if (dt > OB_WIRE) {
- const bool glsl = draw_glsl_material(scene, ob, v3d, dt);
+ if (use_material) {
+ if (dt > OB_WIRE) {
+ const bool glsl = draw_glsl_material(scene, ob, v3d, dt);
- GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
+ GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
+ }
}
draw_em_fancy(scene, ar, v3d, ob, em, cageDM, finalDM, dt);
- GPU_end_object_materials();
+ if (use_material) {
+ GPU_end_object_materials();
+ }
if (obedit != ob)
finalDM->release(finalDM);