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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-01-14 15:51:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-14 15:51:17 +0300
commit97dc31c8d3ed634e19437a7bddbf471fafdcdfc9 (patch)
treedef75e2e7a2c1873933c7b3ee7a197318e86855a /source
parentb0f87935a8d0de0f9ed886c7f26f1b7af41ed12a (diff)
weight paint without shading when in wire view. use stipple wire to help show where verts are.
only way to do this previously was to have a UV layer, be in textured mode, not have any lights or textures and then set weight paint mode.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c88
1 files changed, 59 insertions, 29 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index a5a82b22e27..c3e248c9d7c 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2360,44 +2360,70 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
}
}
else if(dt==OB_SOLID) {
- Paint *p;
+ if(ob==OBACT && ob && ob->mode & OB_MODE_WEIGHT_PAINT) {
+ /* weight paint in solid mode, special case. focus on making the weights clear
+ * rather then the shading, this is also forced in wire view */
+ GPU_enable_material(0, NULL);
+ dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1);
- if((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire && !ob->sculpt)
- draw_mesh_object_outline(v3d, ob, dm);
+ bglPolygonOffset(rv3d->dist, 1.0);
+ glDepthMask(0); // disable write in zbuffer, selected edge wires show better
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED );
+ glEnable(GL_BLEND);
+ glColor4ub(196, 196, 196, 196);
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple(1, 0x8888);
- glEnable(GL_LIGHTING);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+ dm->drawEdges(dm, 1);
- if(ob->sculpt && (p=paint_get_active(scene))) {
- float planes[4][4];
- float (*fpl)[4] = NULL;
- int fast= (p->flags & PAINT_FAST_NAVIGATE) && (rv3d->rflag & RV3D_NAVIGATING);
+ bglPolygonOffset(rv3d->dist, 0.0);
+ glDepthMask(1);
+ glDisable(GL_LINE_STIPPLE);
+
+ GPU_disable_material();
- if(ob->sculpt->partial_redraw) {
- sculpt_get_redraw_planes(planes, ar, rv3d, ob);
- fpl = planes;
- ob->sculpt->partial_redraw = 0;
- }
- dm->drawFacesSolid(dm, fpl, fast, GPU_enable_material);
}
- else
- dm->drawFacesSolid(dm, NULL, 0, GPU_enable_material);
+ else {
+ Paint *p;
- GPU_disable_material();
+ if((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire && !ob->sculpt)
+ draw_mesh_object_outline(v3d, ob, dm);
- glFrontFace(GL_CCW);
- glDisable(GL_LIGHTING);
+ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED );
- if(base->flag & SELECT) {
- UI_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT);
- } else {
- UI_ThemeColor(TH_WIRE);
+ glEnable(GL_LIGHTING);
+ glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+
+ if(ob->sculpt && (p=paint_get_active(scene))) {
+ float planes[4][4];
+ float (*fpl)[4] = NULL;
+ int fast= (p->flags & PAINT_FAST_NAVIGATE) && (rv3d->rflag & RV3D_NAVIGATING);
+
+ if(ob->sculpt->partial_redraw) {
+ sculpt_get_redraw_planes(planes, ar, rv3d, ob);
+ fpl = planes;
+ ob->sculpt->partial_redraw = 0;
+ }
+
+ dm->drawFacesSolid(dm, fpl, fast, GPU_enable_material);
+ }
+ else
+ dm->drawFacesSolid(dm, NULL, 0, GPU_enable_material);
+
+ GPU_disable_material();
+
+ glFrontFace(GL_CCW);
+ glDisable(GL_LIGHTING);
+
+ if(base->flag & SELECT) {
+ UI_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT);
+ } else {
+ UI_ThemeColor(TH_WIRE);
+ }
+ if(!ob->sculpt)
+ dm->drawLooseEdges(dm);
}
- if(!ob->sculpt)
- dm->drawLooseEdges(dm);
}
else if(dt==OB_SHADED) {
int do_draw= 1; /* to resolve all G.f settings below... */
@@ -5298,10 +5324,14 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if(ob->mode & OB_MODE_EDIT);
else {
- if(dt<OB_SOLID)
+ if(dt<OB_SOLID) {
zbufoff= 1;
+ dt= OB_SOLID;
+ }
+ else {
+ dt= OB_SHADED;
+ }
- dt= OB_SHADED;
glEnable(GL_DEPTH_TEST);
}
}