diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-06-25 15:43:22 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-06-25 15:43:22 +0400 |
commit | 3271850a2f59cdcae4bb224522e67b986b8cb9fd (patch) | |
tree | d16f744b2a863f3a7b215d97888ca7bcf8778864 /intern/cycles | |
parent | ae797383b76a4489139b0152a6084b5dd4de2ba3 (diff) |
Fix cycles not working in 3d local view, and missing update when toggling hiding
in the outliner.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_util.h | 22 |
3 files changed, 24 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index d5b884cfccd..a928bd9a6ea 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -305,7 +305,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion) for(; b_sce; b_sce = b_sce.background_set()) { for(b_sce.objects.begin(b_ob); b_ob != b_sce.objects.end(); ++b_ob) { bool hide = (render_layer.use_viewport_visibility)? b_ob->hide(): b_ob->hide_render(); - uint ob_layer = get_layer(b_ob->layers()); + uint ob_layer = get_layer(b_ob->layers(), b_ob->layers_local_view(), object_is_light(*b_ob)); hide = hide || !(ob_layer & scene_layer); if(!hide) { diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 5640a411fd7..c9d2d68da0a 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -219,7 +219,7 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer) layer = layername.c_str(); } else { - render_layer.scene_layer = get_layer(b_v3d.layers()); + render_layer.scene_layer = get_layer(b_v3d.layers(), b_v3d.layers_local_view()); render_layer.layer = render_layer.scene_layer; render_layer.holdout_layer = 0; render_layer.material_override = PointerRNA_NULL; diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index b5a76836bed..ebbd4e1221c 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -166,6 +166,28 @@ 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 is_light = false) +{ + uint layer = 0; + + for(uint i = 0; i < 20; i++) + if(array[i]) + layer |= (1 << i); + + if(is_light) { + /* consider lamps on all local view layers */ + for(uint i = 0; i < 8; i++) + layer |= (1 << (20+i)); + } + else { + for(uint i = 0; i < 8; i++) + if(local_array[i]) + layer |= (1 << (20+i)); + } + + return layer; +} + #if 0 static inline float3 get_float3(PointerRNA& ptr, const char *name) { |