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.
This commit is contained in:
Jeroen Bakker 2020-01-13 09:22:00 +01:00
parent 0ef881cc57
commit 1b86b3c0f4
Notes: blender-bot 2023-02-14 05:01:20 +01:00
Referenced by issue #73069, New studio light requires restart to show specular highlight in viewport
1 changed files with 3 additions and 2 deletions

View File

@ -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);