[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25996] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: weight paint without shading when in wire view.
joe
joeedh at gmail.com
Thu Jan 14 23:16:50 CET 2010
Shouldn't this be an option? Stipple doesn't always work well on all
cards, iirc.
On Thu, Jan 14, 2010 at 4:51 AM, Campbell Barton <ideasman42 at gmail.com> wrote:
> Revision: 25996
> http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25996
> Author: campbellbarton
> Date: 2010-01-14 13:51:17 +0100 (Thu, 14 Jan 2010)
>
> Log Message:
> -----------
> 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.
>
> Modified Paths:
> --------------
> trunk/blender/source/blender/editors/space_view3d/drawobject.c
>
> Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
> ===================================================================
> --- trunk/blender/source/blender/editors/space_view3d/drawobject.c 2010-01-14 10:59:42 UTC (rev 25995)
> +++ trunk/blender/source/blender/editors/space_view3d/drawobject.c 2010-01-14 12:51:17 UTC (rev 25996)
> @@ -2360,44 +2360,70 @@
> }
> }
> 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);
>
> - if(ob->sculpt->partial_redraw) {
> - sculpt_get_redraw_planes(planes, ar, rv3d, ob);
> - fpl = planes;
> - ob->sculpt->partial_redraw = 0;
> - }
> + GPU_disable_material();
>
> - 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 @@
>
> 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);
> }
> }
>
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
More information about the Bf-committers
mailing list