diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-20 10:29:40 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-06-20 10:29:40 +0300 |
commit | e3052ecb0d246381558c75219962915140bbe4ca (patch) | |
tree | a05e59c7c0b94b18bb45fe884bee6af920e241c2 /source/blender/blenkernel/BKE_studiolight.h | |
parent | 91c0f17a475793de7bc6016598ef13221392dbf5 (diff) |
Studiolight: removed raise condition
Happened when deleting many studiolights at the same time when the
previews were still beging calculated in the background.
Added a free function callback that is filled when the preview is being
generated. This free function will then kill the preview job
This patch also removes icons that are not valid anymore so the user
cannot accidentally render an icon where the studiolight is invalid.
In the end we should use a add/remove function in the studiolight as
currently icons are recalculated too much.
Diffstat (limited to 'source/blender/blenkernel/BKE_studiolight.h')
-rw-r--r-- | source/blender/blenkernel/BKE_studiolight.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_studiolight.h b/source/blender/blenkernel/BKE_studiolight.h index a1f43352d8b..f9d679b1b1a 100644 --- a/source/blender/blenkernel/BKE_studiolight.h +++ b/source/blender/blenkernel/BKE_studiolight.h @@ -62,6 +62,7 @@ #define STUDIOLIGHT_ICON_SIZE 96 struct GPUTexture; +struct StudioLight; /* StudioLight.flag */ enum StudioLightFlag { @@ -79,7 +80,6 @@ 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) @@ -87,6 +87,8 @@ enum StudioLightFlag { #define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_WORLD) #define STUDIOLIGHT_ORIENTATIONS_SOLID (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD) +typedef void StudioLightFreeFunction(struct StudioLight *, void *data); + typedef struct StudioLight { struct StudioLight *next, *prev; @@ -109,6 +111,13 @@ typedef struct StudioLight { struct GPUTexture *equirectangular_irradiance_gputexture; float *gpu_matcap_3components; /* 3 channel buffer for GPU_R11F_G11F_B10F */ + /* + Free function to clean up the running icons previews (wmJob) the usage is in + interface_icons. Please be aware that this was build to handle only one free function + that cleans up all icons. just to keep the code simple. + */ + StudioLightFreeFunction *free_function; + void* free_function_data; } StudioLight; void BKE_studiolight_init(void); @@ -120,5 +129,7 @@ void BKE_studiolight_preview(uint* icon_buffer, StudioLight *sl, int icon_id_typ struct ListBase *BKE_studiolight_listbase(void); void BKE_studiolight_ensure_flag(StudioLight *sl, int flag); void BKE_studiolight_refresh(void); +void BKE_studiolight_set_free_function(StudioLight *sl, StudioLightFreeFunction *free_function, void *data); +void BKE_studiolight_unset_icon_id(StudioLight *sl, int icon_id); #endif /* __BKE_STUDIOLIGHT_H__ */ |