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:
authorClément Foucault <foucault.clem@gmail.com>2018-11-29 21:54:23 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-29 23:52:36 +0300
commit844788a36cb0e1efdf3a2010ee67abcb7c46474c (patch)
tree202fbd26d4b397dbcf0eaae063e555591233542d /source/blender/blenkernel/BKE_studiolight.h
parent8f4ab480bfe81f40b59b20780cb452736fe3af1d (diff)
Workbench: Add back studio lighting presets
This changes a bit how the userprefs solid lights works. They are not visible until enabling the "Edit Solid Light" checkbox. Once enabled the current studiolight used for solid mode will be overwritten. Once the lighting settings are tweaked, the user can click the "Save as Studio light" button to save the current settings. This makes it easy to create new lighting without messing the other presets. The studio lights are stored as ASCII files on the disk using a dead simple custom format. The UI/UX is not perfect and will be improved in other commits. Also includes: * Separate LookDev HDRI selection from Solid Lights * Hide LookDev HDRIs from the Solid Lights selection list
Diffstat (limited to 'source/blender/blenkernel/BKE_studiolight.h')
-rw-r--r--source/blender/blenkernel/BKE_studiolight.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_studiolight.h b/source/blender/blenkernel/BKE_studiolight.h
index 6616af355ac..25931e2bbf5 100644
--- a/source/blender/blenkernel/BKE_studiolight.h
+++ b/source/blender/blenkernel/BKE_studiolight.h
@@ -39,6 +39,7 @@
#include "BLI_sys_types.h"
#include "DNA_space_types.h"
+#include "DNA_userdef_types.h"
#include "IMB_imbuf_types.h"
@@ -59,6 +60,8 @@
#define STUDIOLIGHT_ICON_ID_TYPE_MATCAP (1 << 2)
#define STUDIOLIGHT_ICON_ID_TYPE_MATCAP_FLIPPED (1 << 3)
+#define STUDIOLIGHT_MAX_LIGHT 4
+
#define STUDIOLIGHT_ICON_SIZE 96
/* Only 1 - 5 is supported */
@@ -97,7 +100,7 @@ enum StudioLightFlag {
#define STUDIOLIGHT_FLAG_ALL (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_EXTERNAL_FILE)
#define STUDIOLIGHT_FLAG_ORIENTATIONS (STUDIOLIGHT_TYPE_STUDIO | STUDIOLIGHT_TYPE_WORLD | STUDIOLIGHT_TYPE_MATCAP)
#define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE (STUDIOLIGHT_TYPE_WORLD)
-#define STUDIOLIGHT_ORIENTATIONS_SOLID (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_TYPE_STUDIO | STUDIOLIGHT_TYPE_WORLD)
+#define STUDIOLIGHT_ORIENTATIONS_SOLID (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_TYPE_STUDIO)
typedef void StudioLightFreeFunction(struct StudioLight *, void *data);
@@ -121,6 +124,8 @@ typedef struct StudioLight {
ImBuf *radiance_cubemap_buffers[6];
struct GPUTexture *equirect_radiance_gputexture;
struct GPUTexture *equirect_irradiance_gputexture;
+ SolidLight light[STUDIOLIGHT_MAX_LIGHT];
+ float light_ambient[3];
/*
* Free function to clean up the running icons previews (wmJob) the usage is in
@@ -140,7 +145,9 @@ 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);
-StudioLight *BKE_studiolight_new(const char *path, int orientation);
+StudioLight *BKE_studiolight_load(const char *path, int orientation);
+StudioLight *BKE_studiolight_create(const char *path, const SolidLight light[4], const float light_ambient[3]);
+StudioLight *BKE_studiolight_studio_edit_get(void);
void BKE_studiolight_remove(StudioLight *sl);
void BKE_studiolight_set_free_function(StudioLight *sl, StudioLightFreeFunction *free_function, void *data);
void BKE_studiolight_unset_icon_id(StudioLight *sl, int icon_id);