Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-10-11 17:59:51 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-10-11 18:16:53 +0300
commit88005475db5a774edfc3c408b553b04379dbd147 (patch)
tree8ce3bbfcd4e853c6db8320d0a00d09c193bd71cc /intern/cycles/blender/blender_util.h
parent3f4c0612fedf9d135d72c428e2433c890edb0412 (diff)
Cycles: Make light behavior in local view matching BI
Title says it all, based on feedback of artists from gooseberry team. This mainly affects cases when going to a local view from layers setup when some lamps were on invisible layers. Those lights are no longer becoming visible to the object in local view. Reviewers: brecht, juicyfruit, dingto Reviewed By: juicyfruit, dingto Subscribers: maxon, eyecandy, venomgfx Differential Revision: https://developer.blender.org/D1326
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r--intern/cycles/blender/blender_util.h16
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++)