From 56bccd2395e4dd205ab6e426b24269c70534ea85 Mon Sep 17 00:00:00 2001 From: Nathan Craddock Date: Mon, 1 Feb 2021 21:41:48 -0700 Subject: Fix T83450: Missing 4th studio light in preview icon Due to an off-by-one error the generated studio light icons did not show the influence of the 4th light. This fix changes the loop to iterate over all of the lights when computing the lighting. Differential Revision: https://developer.blender.org/D10283 --- source/blender/blenkernel/intern/studiolight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index b7b5b6997c2..5bffcd4d9e7 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -1065,7 +1065,7 @@ static void studiolight_lights_eval(StudioLight *sl, float color[3], const float copy_v3_v3(spec_light, sl->light_ambient); reflect_v3_v3v3(R, I, N); - for (int i = 0; i < 3; i++) { + for (int i = 0; i < STUDIOLIGHT_MAX_LIGHT; i++) { SolidLight *light = &sl->light[i]; if (light->flag) { /* Diffuse lighting */ -- cgit v1.2.3