diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_studiolight.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/studiolight.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_studiolight.h b/source/blender/blenkernel/BKE_studiolight.h index 7ffb75820df..a1f43352d8b 100644 --- a/source/blender/blenkernel/BKE_studiolight.h +++ b/source/blender/blenkernel/BKE_studiolight.h @@ -79,6 +79,7 @@ enum StudioLightFlag { STUDIOLIGHT_EQUIRECTANGULAR_IRRADIANCE_GPUTEXTURE = (1 << 10), STUDIOLIGHT_RADIANCE_BUFFERS_CALCULATED = (1 << 11), STUDIOLIGHT_UI_EXPANDED = (1 << 13), + STUDIOLIGHT_DISABLED = (1 << 14), } StudioLightFlag; #define STUDIOLIGHT_FLAG_ALL (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_EXTERNAL_FILE) @@ -107,6 +108,7 @@ typedef struct StudioLight { struct GPUTexture *equirectangular_radiance_gputexture; struct GPUTexture *equirectangular_irradiance_gputexture; float *gpu_matcap_3components; /* 3 channel buffer for GPU_R11F_G11F_B10F */ + } StudioLight; void BKE_studiolight_init(void); diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index 3cdb8da75b5..42a6b96653f 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -115,6 +115,7 @@ static struct StudioLight *studiolight_create(int flag) for (int index = 0 ; index < 6 ; index ++) { sl->radiance_cubemap_buffers[index] = NULL; } + return sl; } @@ -891,7 +892,7 @@ void BKE_studiolight_free(void) struct StudioLight *BKE_studiolight_find_first(int flag) { LISTBASE_FOREACH(StudioLight *, sl, &studiolights) { - if ((sl->flag & flag)) { + if ((sl->flag & flag) && (sl->flag & STUDIOLIGHT_DISABLED) == 0) { return sl; } } @@ -902,7 +903,7 @@ struct StudioLight *BKE_studiolight_find(const char *name, int flag) { LISTBASE_FOREACH(StudioLight *, sl, &studiolights) { if (STREQLEN(sl->name, name, FILE_MAXFILE)) { - if ((sl->flag & flag)) { + if ((sl->flag & flag) && (sl->flag & STUDIOLIGHT_DISABLED) == 0) { return sl; } else { @@ -918,7 +919,7 @@ struct StudioLight *BKE_studiolight_find(const char *name, int flag) struct StudioLight *BKE_studiolight_findindex(int index, int flag) { LISTBASE_FOREACH(StudioLight *, sl, &studiolights) { - if (sl->index == index) { + if (sl->index == index && (sl->flag & STUDIOLIGHT_DISABLED) == 0) { return sl; } } @@ -994,6 +995,8 @@ void BKE_studiolight_ensure_flag(StudioLight *sl, int flag) void BKE_studiolight_refresh(void) { - BKE_studiolight_free(); + LISTBASE_FOREACH(StudioLight *, sl, &studiolights) { + sl->flag |= STUDIOLIGHT_DISABLED; + } BKE_studiolight_init(); } |