fix [#27627] Strange behavior with solid open gl lights

disable turning off all lights in the user preferences.
This commit is contained in:
Campbell Barton 2011-06-10 16:59:15 +00:00
parent 753623d1d7
commit ce3f040e14

@ -245,6 +245,13 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN
static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
/* if all lights are off gpu_draw resets them all, [#27627]
* so disallow them all to be disabled */
if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
SolidLight *light= ptr->data;
light->flag |= 1;
}
WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL); WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
rna_userdef_update(bmain, scene, ptr); rna_userdef_update(bmain, scene, ptr);
} }