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-05-25 09:06:36 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-05-28 18:07:39 +0300
commit765fd29d6855d098d8fcdd72ba595dfd1e4e4e17 (patch)
treef1877bfcaf5f4a309f294e2fb516a61c9d6f01aa /source/blender/makesrna
parentce5fa2decad115f023e2f5591255078768b4fa5e (diff)
EEvEE: LookDev
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_space.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index a925f5ba2f1..65edc619ced 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -655,12 +655,7 @@ static int rna_3DViewShading_type_get(PointerRNA *ptr)
RenderEngineType *type = RE_engines_find(scene->r.engine);
View3D *v3d = (View3D *)ptr->data;
- if (BKE_scene_uses_blender_eevee(scene)) {
- if (v3d->drawtype == OB_MATERIAL) {
- return OB_RENDER;
- }
- }
- else if (v3d->drawtype == OB_RENDER) {
+ if (!BKE_scene_uses_blender_eevee(scene) && v3d->drawtype == OB_RENDER) {
if (!(type && type->render_to_view)) {
return OB_MATERIAL;
}
@@ -693,6 +688,7 @@ static const EnumPropertyItem *rna_3DViewShading_type_itemf(
RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_type_items, OB_TEXTURE);
if (BKE_scene_uses_blender_eevee(scene)) {
+ RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_type_items, OB_MATERIAL);
RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_type_items, OB_RENDER);
}
else {
@@ -711,7 +707,7 @@ static const EnumPropertyItem *rna_3DViewShading_type_itemf(
static int rna_View3DShading_studio_light_orientation_get(PointerRNA *ptr)
{
View3D *v3d = (View3D *)ptr->data;
- StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light);
+ StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light, 0);
return sl->flag & (STUDIOLIGHT_ORIENTATION_WORLD | STUDIOLIGHT_ORIENTATION_CAMERA);
}
static void rna_View3DShading_studio_light_orientation_set(PointerRNA *UNUSED(ptr), int UNUSED(value))
@@ -721,7 +717,9 @@ static void rna_View3DShading_studio_light_orientation_set(PointerRNA *UNUSED(pt
static int rna_View3DShading_studio_light_get(PointerRNA *ptr)
{
View3D *v3d = (View3D *)ptr->data;
- StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light);
+ const int flag = v3d->drawtype == OB_MATERIAL? STUDIOLIGHT_ORIENTATION_WORLD: 0;
+ StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light, flag);
+ BLI_strncpy(v3d->shading.studio_light, sl->name, FILE_MAXFILE);
return sl->index;
}
@@ -733,19 +731,40 @@ static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value)
}
static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(
- bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
+ bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), bool *r_free)
{
+ View3D *v3d = (View3D *)ptr->data;
EnumPropertyItem *item = NULL;
EnumPropertyItem *lastitem;
int totitem = 0;
+ bool show_studiolight;
LISTBASE_FOREACH(StudioLight *, sl, BKE_studiolight_listbase()) {
- if (totitem < NUM_STUDIOLIGHT_ITEMS) {
- RNA_enum_items_add_value(&item, &totitem, rna_enum_studio_light_items, totitem);
+ show_studiolight = false;
+ int icon_id = sl->irradiance_icon_id;
+
+ if ((sl->flag & STUDIOLIGHT_EXTERNAL_FILE) == 0) {
+ /* always show internal lights */
+ show_studiolight = true;
+ } else {
+ switch (v3d->drawtype) {
+ case OB_SOLID:
+ case OB_TEXTURE:
+ show_studiolight = true;
+ break;
+ case OB_MATERIAL:
+ show_studiolight = (sl->flag & STUDIOLIGHT_ORIENTATION_WORLD) > 0;
+ icon_id = sl->radiance_icon_id;
+ break;
+ }
+ }
+
+ if (show_studiolight && totitem < NUM_STUDIOLIGHT_ITEMS) {
+ RNA_enum_items_add_value(&item, &totitem, rna_enum_studio_light_items, sl->index);
lastitem = &item[totitem - 1];
lastitem->value = sl->index;
- lastitem->icon = sl->icon_id;
+ lastitem->icon = icon_id;
lastitem->name = sl->name;
}
}