Bugfix; using weightpaint changed the default lighting setup (specular).

This commit is contained in:
Ton Roosendaal 2005-10-20 19:27:47 +00:00
parent 197fdd2e36
commit c677ffdebb

@ -1699,13 +1699,21 @@ static void draw_mesh_fancy(Object *ob, DerivedMesh *baseDM, DerivedMesh *dm, in
} }
else if(dt==OB_SHADED) { else if(dt==OB_SHADED) {
if( (G.f & G_WEIGHTPAINT)) { if( (G.f & G_WEIGHTPAINT)) {
set_gl_material(0); /* enforce defmaterial settings */
/* but set default spec */
glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
glEnable(GL_COLOR_MATERIAL); /* according manpages needed */
glColor3ub(120, 120, 120);
glDisable(GL_COLOR_MATERIAL);
/* diffuse */
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL); glEnable(GL_COLOR_MATERIAL);
set_gl_material(0); // defmaterial settings
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1); dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1);
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL); glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
} }
else if((G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) && me->mcol) { else if((G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) && me->mcol) {
dm->drawMappedFaces(dm, NULL, NULL, 1); dm->drawMappedFaces(dm, NULL, NULL, 1);