Fix #30061: cycles single render layer through python operator parameter not
[blender.git] / intern / cycles / blender / blender_session.cpp
index 5ea3f2ce16edc7656cd173c8d0b81ce07a20d3c0..cc6ba0731880e002203ceb51c3b115245ed567cd 100644 (file)
@@ -191,14 +191,8 @@ void BlenderSession::render()
        BL::RenderResult::layers_iterator b_iter;
        BL::RenderLayers b_rr_layers(r.ptr);
        
-       int active = 0;
-
        /* render each layer */
-       for(b_rr.layers.begin(b_iter); b_iter != b_rr.layers.end(); ++b_iter, ++active) {
-               /* single layer render */
-               if(r.use_single_layer())
-                       active = b_rr_layers.active_index();
-
+       for(b_rr.layers.begin(b_iter); b_iter != b_rr.layers.end(); ++b_iter) {
                /* set layer */
                b_rlay = *b_iter;
 
@@ -226,7 +220,7 @@ void BlenderSession::render()
                session->reset(buffer_params, session_params.samples);
 
                /* update scene */
-               sync->sync_data(b_v3d, active);
+               sync->sync_data(b_v3d, b_iter->name().c_str());
 
                /* render */
                session->start();