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:
authorGaia Clary <gaia.clary@machinimatrix.org>2014-06-18 22:01:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-06-18 22:10:07 +0400
commitbab75f8bf6a7b26e824f4d76d580940a1deb4489 (patch)
treee7f6c37891f2120e44f7ca156c3f75c39fcad576 /source/blender/editors/space_view3d/view3d_draw.c
parentef5d6edb4a87d17e95ccc9250bc019e8828eee58 (diff)
Editmesh: add ability to show weights on wire T39054, D585
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index ce74c547610..5ec15a28c36 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -37,6 +37,7 @@
#include "DNA_customdata_types.h"
#include "DNA_object_types.h"
#include "DNA_group_types.h"
+#include "DNA_mesh_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_scene_types.h"
@@ -2607,12 +2608,25 @@ static void view3d_draw_objects(
/* set zbuffer after we draw clipping region */
if (v3d->drawtype > OB_WIRE) {
v3d->zbuf = true;
- glEnable(GL_DEPTH_TEST);
}
else {
v3d->zbuf = false;
}
+ /* special case (depth for wire color) */
+ if (v3d->drawtype <= OB_WIRE) {
+ if (scene->obedit && scene->obedit->type == OB_MESH) {
+ Mesh *me = scene->obedit->data;
+ if (me->drawflag & ME_DRAWEIGHT) {
+ v3d->zbuf = true;
+ }
+ }
+ }
+
+ if (v3d->zbuf) {
+ glEnable(GL_DEPTH_TEST);
+ }
+
if (!draw_offscreen) {
/* needs to be done always, gridview is adjusted in drawgrid() now, but only for ortho views. */
rv3d->gridview = v3d->grid;