Commit: 1b86b3c0f4ab84e3b47c04a63a69ffb61dc8660e
Author: Jeroen Bakker
Date:   Mon Jan 13 09:22:00 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB1b86b3c0f4ab84e3b47c04a63a69ffb61dc8660e

Fix T73069: Studiolights

Studiolights that were just created didn't had the
`STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS` flag. Without this flag the
studiolight the viewport didn't show the specular highlights and it
wasn't possible to switch the highlights on/off in the popover. After
reloading the studio lights this was possible.

This patch will always set the flag for any newly created, or being
edited studiolight, so the workbench render engine is fed with the right
data.

===================================================================

M       source/blender/blenkernel/intern/studiolight.c

===================================================================

diff --git a/source/blender/blenkernel/intern/studiolight.c 
b/source/blender/blenkernel/intern/studiolight.c
index a02ff98a38a..9008348ed3b 100644
--- a/source/blender/blenkernel/intern/studiolight.c
+++ b/source/blender/blenkernel/intern/studiolight.c
@@ -1668,7 +1668,8 @@ StudioLight *BKE_studiolight_create(const char *path,
                                     const float light_ambient[3])
 {
   StudioLight *sl = studiolight_create(STUDIOLIGHT_EXTERNAL_FILE | 
STUDIOLIGHT_USER_DEFINED |
-                                       STUDIOLIGHT_TYPE_STUDIO);
+                                       STUDIOLIGHT_TYPE_STUDIO |
+                                       STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS);
 
   char filename[FILE_MAXFILE];
   BLI_split_file_part(path, filename, FILE_MAXFILE);
@@ -1688,7 +1689,7 @@ StudioLight *BKE_studiolight_create(const char *path,
 StudioLight *BKE_studiolight_studio_edit_get(void)
 {
   static StudioLight sl = {0};
-  sl.flag = STUDIOLIGHT_TYPE_STUDIO;
+  sl.flag = STUDIOLIGHT_TYPE_STUDIO | STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS;
 
   memcpy(sl.light, U.light_param, sizeof(*sl.light) * 4);
   memcpy(sl.light_ambient, U.light_ambient, sizeof(*sl.light_ambient) * 3);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to