Merge branch 'master' into blender2.8
[blender.git] / intern / cycles / blender / blender_sync.cpp
index e953c685b565be351d680836251f903a8c9c32a5..adbabaccdc1c3246726fbdcd4475fc76eec4aaed 100644 (file)
@@ -44,6 +44,7 @@ CCL_NAMESPACE_BEGIN
 
 BlenderSync::BlenderSync(BL::RenderEngine& b_engine,
                          BL::BlendData& b_data,
+                         BL::Depsgraph& b_depsgraph,
                          BL::Scene& b_scene,
                          Scene *scene,
                          bool preview,
@@ -51,7 +52,9 @@ BlenderSync::BlenderSync(BL::RenderEngine& b_engine,
                          bool is_cpu)
 : b_engine(b_engine),
   b_data(b_data),
+  b_depsgraph(b_depsgraph),
   b_scene(b_scene),
+  b_scene_layer(b_engine.scene_layer()),
   shader_map(&scene->shaders),
   object_map(&scene->objects),
   mesh_map(&scene->meshes),
@@ -382,26 +385,9 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer)
 
        /* 3d view */
        if(b_v3d) {
-               if(RNA_boolean_get(&cscene, "preview_active_layer")) {
-                       BL::RenderLayers layers(b_scene.render().ptr);
-                       layername = layers.active().name();
-                       layer = layername.c_str();
-               }
-               else {
-                       render_layer.scene_layer = get_layer(b_v3d.layers(), b_v3d.layers_local_view());
-                       render_layer.layer = render_layer.scene_layer;
-                       render_layer.exclude_layer = 0;
-                       render_layer.holdout_layer = 0;
-                       render_layer.material_override = PointerRNA_NULL;
-                       render_layer.use_background_shader = true;
-                       render_layer.use_background_ao = true;
-                       render_layer.use_hair = true;
-                       render_layer.use_surfaces = true;
-                       render_layer.use_viewport_visibility = true;
-                       render_layer.samples = 0;
-                       render_layer.bound_samples = false;
-                       return;
-               }
+               BL::RenderLayers layers(b_scene.render().ptr);
+               layername = layers.active().name();
+               layer = layername.c_str();
        }
 
        /* render layer */
@@ -430,7 +416,6 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer)
                        render_layer.use_background_ao = b_rlay->use_ao();
                        render_layer.use_surfaces = b_rlay->use_solid();
                        render_layer.use_hair = b_rlay->use_strand();
-                       render_layer.use_viewport_visibility = false;
 
                        render_layer.bound_samples = (use_layer_samples == 1);
                        if(use_layer_samples != 2) {
@@ -840,17 +825,8 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
                params.shadingsystem = SHADINGSYSTEM_OSL;
        
        /* color managagement */
-#ifdef GLEW_MX
-       /* When using GLEW MX we need to check whether we've got an OpenGL
-        * context for current window. This is because command line rendering
-        * doesn't have OpenGL context actually.
-        */
-       if(glewGetContext() != NULL)
-#endif
-       {
-               params.display_buffer_linear = GLEW_ARB_half_float_pixel &&
-                                              b_engine.support_display_space_shader(b_scene);
-       }
+       params.display_buffer_linear = GLEW_ARB_half_float_pixel &&
+                                      b_engine.support_display_space_shader(b_scene);
 
        if(b_engine.is_preview()) {
                /* For preview rendering we're using same timeout as