EEVEE: LookDev overlays enabling

The mirror ball and diffuse ball are only rendered when overlays are
turned on and the lookdev overlay is turned on.
This commit is contained in:
Jeroen Bakker 2018-05-29 09:08:32 +02:00
parent 6946c41340
commit 77e32e8819
Notes: blender-bot 2023-02-14 06:17:14 +01:00
Referenced by issue #55241, Crash when creating a Torus  in existing file
7 changed files with 18 additions and 1 deletions

View 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")

View 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;
}
}
}

View 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);

View 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,

View 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;

View 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 */

View 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");