From 909fa08a7654e411b3fba90178a7003646ca7e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 30 Nov 2018 13:58:27 +0100 Subject: StudioLight: Add a 4th light to adjust lighting There was a bug due to non-aligned struct in the DNA that prevented us to increase the size of the userdef light array. Since the studio lights are now presets and stored in external files, there is no need to keep backward compatibility with theses lights. Remove the old array and create a new one. Add blue tint light for specular. --- source/blender/blenkernel/intern/studiolight.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/studiolight.c') diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index 3a98d5ea90a..5196ae50bab 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -1210,6 +1210,12 @@ void BKE_studiolight_init(void) sl->light[2].flag = 1; sl->light[2].smooth = 0.5; + copy_v4_fl4(sl->light[3].vec, 0.021053, -0.989474, 0.143173, 0.0); + copy_v4_fl4(sl->light[3].col, 0.0, 0.0, 0.0, 1.0); + copy_v4_fl4(sl->light[3].spec, 0.072234, 0.082253, 0.162642, 1.000000); + sl->light[3].flag = 1; + sl->light[3].smooth = 0.7; + BLI_addtail(&studiolights, sl); /* go over the preset folder and add a studiolight for every image with its path */ @@ -1360,7 +1366,7 @@ StudioLight *BKE_studiolight_create(const char *path, const SolidLight light[4], BLI_snprintf(sl->path, FILE_MAXFILE, "%s%s", path, ".sl"); BLI_snprintf(sl->name, FILE_MAXFILE, "%s%s", filename, ".sl"); - memcpy(sl->light, light, sizeof(*light) * 3); + memcpy(sl->light, light, sizeof(*light) * 4); memcpy(sl->light_ambient, light_ambient, sizeof(*light_ambient) * 3); studiolight_write_solid_light(sl); @@ -1375,7 +1381,7 @@ StudioLight *BKE_studiolight_studio_edit_get(void) static StudioLight sl = {0}; sl.flag = STUDIOLIGHT_TYPE_STUDIO; - memcpy(sl.light, U.light, sizeof(*sl.light) * 3); + memcpy(sl.light, U.light_param, sizeof(*sl.light) * 4); memcpy(sl.light_ambient, U.light_ambient, sizeof(*sl.light_ambient) * 3); return &sl; -- cgit v1.2.3