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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-06-19 17:33:47 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-06-19 17:37:23 +0300
commit0116c95d4c9114bc9eae03401c0471fba265cd46 (patch)
tree19874eadddab1b5349cd092b9ec37e6290d02694 /source/blender/makesrna/intern/rna_space.c
parenta7e66d89d04662da8a90eab1eb119e8fb8ccaa2b (diff)
Studiolight: Temp Mutex issue
This is a temp fix for a better system. Currently the studiolights can be referenced by a WM_job and being freed via the API. This can happen when removing a studiolight via the interface. As the studiolight has no relation with the job, it is hard to detect if it is still being used. I tried with a Mutex and a Thread Queue but they were failing. So the current temp fix is to keep the studiolights in memory until you close blender. This Must be fixed ASAP! I added this fix so normal cases can workish.
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 13ea2dd436e..c886f19d134 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -766,6 +766,9 @@ static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(
const int flags = (STUDIOLIGHT_EXTERNAL_FILE | STUDIOLIGHT_ORIENTATION_VIEWNORMAL);
LISTBASE_FOREACH(StudioLight *, sl, BKE_studiolight_listbase()) {
+ if ((sl->flag & STUDIOLIGHT_DISABLED)){
+ continue;
+ }
int icon_id = (v3d->shading.flag & V3D_SHADING_MATCAP_FLIP_X) ? sl->icon_id_matcap_flipped: sl->icon_id_matcap;
if ((sl->flag & flags) == flags) {
EnumPropertyItem tmp = {sl->index, sl->name, icon_id, sl->name, ""};
@@ -775,10 +778,13 @@ static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(
}
else {
LISTBASE_FOREACH(StudioLight *, sl, BKE_studiolight_listbase()) {
+ if ((sl->flag & STUDIOLIGHT_DISABLED)){
+ continue;
+ }
int icon_id = sl->icon_id_irradiance;
bool show_studiolight = false;
- if ((sl->flag & STUDIOLIGHT_INTERNAL)) {
+ if (sl->flag & STUDIOLIGHT_INTERNAL) {
/* always show internal lights */
show_studiolight = true;
}