From 93a8fd1249ffc64ee089b8c3192908dec247fc07 Mon Sep 17 00:00:00 2001 From: Jesse Yurkovich Date: Fri, 15 Oct 2021 11:42:21 +0200 Subject: Cleanup: Commonize code for checking scene lights/world settings There were several places attempting to check to see if scene lights and world were enabled for display. This tries to find a common place for both of these to reduce duplication. Honestly, I couldn't find a really good spot for these and settled on DRW_engine. It's not the best spot since they're not strictly drawing related, but let's start here. Reviewed By: fclem Differential Revision: https://developer.blender.org/D12658 --- source/blender/makesdna/DNA_view3d_types.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index fafc470b95a..d5db72ea85a 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -500,6 +500,18 @@ enum { V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION = (1 << 14), }; +#define V3D_USES_SCENE_LIGHTS(v3d) \ + ((v3d) && \ + ((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS)) || \ + (((v3d)->shading.type == OB_RENDER) && \ + ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS_RENDER)))) + +#define V3D_USES_SCENE_WORLD(v3d) \ + ((v3d) && \ + ((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD)) || \ + (((v3d)->shading.type == OB_RENDER) && \ + ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER)))) + /** #View3DShading.cavity_type */ enum { V3D_SHADING_CAVITY_SSAO = 0, -- cgit v1.2.3