Fix T46749: Texture paint & shadeless mode fails

Using shadeless did nothing in texture-paint mode.
(regression in 2.76)
This commit is contained in:
Campbell Barton 2015-11-13 06:12:30 +11:00
parent bd9005ef3b
commit 930771d0cf
Notes: blender-bot 2024-03-22 15:57:27 +01:00
Referenced by issue #46749, Shadeless mode in texture painting mode not working
2 changed files with 15 additions and 5 deletions

View File

@ -3046,7 +3046,7 @@ class VIEW3D_PT_view3d_shading(Panel):
col.prop(view, "use_matcap")
if view.use_matcap:
col.template_icon_view(view, "matcap_icon")
elif view.viewport_shade == 'TEXTURED':
if view.viewport_shade == 'TEXTURED' or context.mode == 'PAINT_TEXTURE':
if scene.render.use_shading_nodes or gs.material_mode != 'GLSL':
col.prop(view, "show_textured_shadeless")

View File

@ -410,9 +410,15 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
solidtex = false;
Gtexdraw.is_lit = 0;
}
else if ((ob->mode & OB_MODE_TEXTURE_PAINT) && BKE_scene_use_new_shading_nodes(scene)) {
solidtex = true;
if (v3d->flag2 & V3D_SHADELESS_TEX)
Gtexdraw.is_lit = 0;
else
Gtexdraw.is_lit = -1;
}
else if ((v3d->drawtype == OB_SOLID) ||
((ob->mode & OB_MODE_EDIT) && (v3d->drawtype != OB_TEXTURE)) ||
((ob->mode & OB_MODE_TEXTURE_PAINT) && BKE_scene_use_new_shading_nodes(scene)))
((ob->mode & OB_MODE_EDIT) && (v3d->drawtype != OB_TEXTURE)))
{
/* draw with default lights in solid draw mode and edit mode */
solidtex = true;
@ -1132,10 +1138,14 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
else glFrontFace(GL_CCW);
if ((v3d->drawtype == OB_TEXTURE) && (v3d->flag2 & V3D_SHADELESS_TEX))
if ((v3d->flag2 & V3D_SHADELESS_TEX) &&
((v3d->drawtype == OB_TEXTURE) || (ob->mode & OB_MODE_TEXTURE_PAINT)))
{
glColor3f(1.0f, 1.0f, 1.0f);
else
}
else {
glEnable(GL_LIGHTING);
}
{
Mesh *me = ob->data;