diff options
m--------- | release/scripts/addons | 0 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.c | 12 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_color_management.cc | 11 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_types.h | 12 |
5 files changed, 20 insertions, 21 deletions
diff --git a/release/scripts/addons b/release/scripts/addons -Subproject f10ca8c156169b24e70027a43f718f99571d280 +Subproject 67f1fbca1482d9d9362a4001332e785c3fd5d23 diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 1078cebdbff..50e32040522 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -120,15 +120,9 @@ void GPENCIL_engine_init(void *ved) bool use_scene_world = false; if (v3d) { - use_scene_lights = ((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)); - - use_scene_world = ((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)); + use_scene_lights = V3D_USES_SCENE_LIGHTS(v3d); + + use_scene_world = V3D_USES_SCENE_WORLD(v3d); stl->pd->v3d_color_type = (v3d->shading.type == OB_SOLID) ? v3d->shading.color_type : -1; /* Special case: If Vertex Paint mode, use always Vertex mode. */ diff --git a/source/blender/draw/intern/draw_color_management.cc b/source/blender/draw/intern/draw_color_management.cc index 23fa18c83c5..70035c7c6f8 100644 --- a/source/blender/draw/intern/draw_color_management.cc +++ b/source/blender/draw/intern/draw_color_management.cc @@ -30,6 +30,7 @@ #include "GPU_texture.h" #include "DNA_space_types.h" +#include "DNA_view3d_types.h" #include "BKE_colortools.h" @@ -60,14 +61,8 @@ static eDRWColorManagementType drw_color_management_type_for_v3d(const Scene &sc { const bool use_workbench = BKE_scene_uses_blender_workbench(&scene); - const bool use_scene_lights = ((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)); - const bool use_scene_world = ((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)); + const bool use_scene_lights = V3D_USES_SCENE_LIGHTS(&v3d); + const bool use_scene_world = V3D_USES_SCENE_WORLD(&v3d); if ((use_workbench && v3d.shading.type == OB_RENDER) || use_scene_lights || use_scene_world) { return eDRWColorManagementType::UseRenderSettings; diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index bda6fa05a63..787cf529483 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -30,6 +30,7 @@ #include "DNA_material_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_view3d_types.h" #include "MEM_guardedalloc.h" @@ -1569,10 +1570,7 @@ static void space_view3d_listener(const wmSpaceTypeListenerParams *params) case NC_SCENE: switch (wmn->data) { case ND_WORLD: { - const bool use_scene_world = ((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)); + const bool use_scene_world = V3D_USES_SCENE_WORLD(v3d); if (v3d->flag2 & V3D_HIDE_OVERLAYS || use_scene_world) { ED_area_tag_redraw_regiontype(area, RGN_TYPE_WINDOW); } 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, |