EEVEE: LookDev overlays enabling
authorJeroen Bakker <j.bakker@atmind.nl>
Tue, 29 May 2018 07:08:32 +0000 (09:08 +0200)
committerJeroen Bakker <j.bakker@atmind.nl>
Tue, 29 May 2018 07:08:32 +0000 (09:08 +0200)
The mirror ball and diffuse ball are only rendered when overlays are
turned on and the lookdev overlay is turned on.

release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenloader/intern/versioning_280.c
source/blender/draw/engines/eevee/eevee_lookdev.c
source/blender/draw/engines/eevee/eevee_private.h
source/blender/editors/space_view3d/space_view3d.c
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/intern/rna_space.c

index c9decadf150a96511019f5e74fd7724ea8cbd2bb..deaf3dd1d4e0ca76fb50424e21eb085438672754 100644 (file)
@@ -3564,6 +3564,7 @@ class VIEW3D_PT_overlay(Panel):
         layout = self.layout
 
         view = context.space_data
+        shading = view.shading
         overlay = view.overlay
         scene = context.scene
         toolsettings = context.tool_settings
@@ -3578,6 +3579,9 @@ class VIEW3D_PT_overlay(Panel):
 
         col.prop(view, "show_manipulator", text="Manipulators")
 
+        if shading.type == "MATERIAL":
+            col.prop(overlay, "show_look_dev")
+
         col = layout.column()
         col.active = display_all
         col.prop(overlay, "show_outline_selected")
index a25c744afc49eab93acf5b37760d8167655cd06b..2331bc07f0f106b2448b16b56728a29227d13a2d 100644 (file)
@@ -1206,6 +1206,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
 
                                                v3d->overlay.backwire_opacity = 0.5f;
                                                v3d->overlay.normals_length = 0.1f;
+                                               v3d->overlay.flag = V3D_OVERLAY_LOOK_DEV;
                                        }
                                }
                        }
index 4ae13669a019b23e83bb27a9903fea045c38019c..e92cbe76472246cb27b1b588988e613719996a5b 100644 (file)
@@ -74,7 +74,7 @@ void EEVEE_lookdev_draw_background(EEVEE_Data *vedata)
        
        const DRWContextState *draw_ctx = DRW_context_state_get();
 
-       if (psl->lookdev_pass && draw_ctx->v3d) {
+       if (psl->lookdev_pass && LOOK_DEV_OVERLAY_ENABLED(draw_ctx->v3d)) {
                DRW_stats_group_start("Look Dev");
                CameraParams params;
                BKE_camera_params_init(&params);
index 10a53db5e35b05a66b7a62906f8bf1e5ee1824d7..52497b492fc0bd842ec461df5a0cc3de3c624024 100644 (file)
@@ -92,6 +92,9 @@ extern struct DrawEngineType draw_engine_eevee_type;
        }                                              \
 } ((void)0)
 
+#define OVERLAY_ENABLED(v3d) ((v3d) && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0)
+#define LOOK_DEV_OVERLAY_ENABLED(v3d) (OVERLAY_ENABLED(v3d) && ((v3d->overlay.flag & V3D_OVERLAY_LOOK_DEV) > 0))
+
 /* World shader variations */
 enum {
        VAR_WORLD_BACKGROUND    = 0,
index 6d8d4d45febd0b99769382f58e0167a51c73f137..b50eac7e2ed741825098553deb6f72c971a7bcee 100644 (file)
@@ -327,6 +327,8 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene)
        v3d->shading.shadow_intensity = 0.5;
        copy_v3_fl(v3d->shading.single_color, 0.8f);
 
+       v3d->overlay.flag = V3D_OVERLAY_LOOK_DEV;
+
        v3d->gridflag = V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_FLOOR;
        
        v3d->flag = V3D_SELECT_OUTLINE;
index dd3e0c2599208c9a659c334fd47b8aa6b7494460..ed03502606ed87568715a81be92f71b26cf5fda0 100644 (file)
@@ -355,6 +355,7 @@ enum {
        V3D_OVERLAY_FACE_ORIENTATION  = (1 << 0),
        V3D_OVERLAY_HIDE_CURSOR       = (1 << 1),
        V3D_OVERLAY_BONE_SELECTION    = (1 << 2),
+       V3D_OVERLAY_LOOK_DEV          = (1 << 3),
 };
 
 /* View3DOverlay->edit_flag */
index 65edc619ced996385b5e39410b25b4e1de4eeab6..284d229b19149cc19806251c4901da0ffe3b446c 100644 (file)
@@ -2451,6 +2451,12 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Bone Selection", "Show the Bone Selection Overlay");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
+       prop = RNA_def_property(srna, "show_look_dev", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_LOOK_DEV);
+       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+       RNA_def_property_ui_text(prop, "Look Dev", "Show Look Development Balls and Palette");
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
        prop = RNA_def_property(srna, "show_paint_wire", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "overlay.paint_flag", V3D_OVERLAY_PAINT_WIRE);
        RNA_def_property_ui_text(prop, "Show Wire", "Use wireframe display in painting modes");