Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-11-30 15:58:27 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-30 17:40:57 +0300
commit909fa08a7654e411b3fba90178a7003646ca7e54 (patch)
tree1e7a8cb02edac7e4c96a0cd08eb265b696247127 /source/blender/blenkernel/intern/studiolight.c
parent856b858f88052371f231c69c182e6169101f9b39 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/studiolight.c')
-rw-r--r--source/blender/blenkernel/intern/studiolight.c10
1 files changed, 8 insertions, 2 deletions
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;