diff options
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r-- | intern/cycles/blender/blender_util.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 165242d0dff..bd1c37a7560 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -196,7 +196,11 @@ static inline uint get_layer(BL::Array<int, 20> array) return layer; } -static inline uint get_layer(BL::Array<int, 20> array, BL::Array<int, 8> local_array, bool use_local, bool is_light = false) +static inline uint get_layer(BL::Array<int, 20> array, + BL::Array<int, 8> local_array, + bool use_local, + bool is_light = false, + uint scene_layers = (1 << 20) - 1) { uint layer = 0; @@ -205,9 +209,13 @@ static inline uint get_layer(BL::Array<int, 20> array, BL::Array<int, 8> local_a layer |= (1 << i); if(is_light) { - /* consider lamps on all local view layers */ - for(uint i = 0; i < 8; i++) - layer |= (1 << (20+i)); + /* Consider light is visible if it was visible without layer + * override, which matches behavior of Blender Internal. + */ + if(layer & scene_layers) { + for(uint i = 0; i < 8; i++) + layer |= (1 << (20+i)); + } } else { for(uint i = 0; i < 8; i++) |