Cycles: always use static bvh for non-viewport render.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 4 Nov 2011 15:46:15 +0000 (15:46 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 4 Nov 2011 15:46:15 +0000 (15:46 +0000)
intern/cycles/blender/addon/properties.py
intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/blender/blender_sync.h

index 0d30307fc73d68e2bf5ab0335dd4f4fba0c27085..a58e4dfd1546e856020de09a1a188e9a572a33ca 100644 (file)
@@ -92,7 +92,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         cls.debug_text_timeout = FloatProperty(name="Text timeout", description="",
             default=1.0, min=0.01, max=10.0)
 
-        cls.debug_bvh_type = EnumProperty(name="BVH Type", description="Choose between faster updates, or faster render",
+        cls.debug_bvh_type = EnumProperty(name="Viewport BVH Type", description="Choose between faster updates, or faster render",
             items=enums.bvh_types, default="DYNAMIC_BVH")
         cls.debug_use_spatial_splits = BoolProperty(name="Use Spatial Splits", description="Use BVH spatial splits: longer builder time, faster render",
             default=False)
index 4fa878156012f4eb580e2508b99c433904b5312a..4433b1e24f9149f65e6a0cdc5a1ce6bddb74d376 100644 (file)
@@ -73,7 +73,7 @@ BlenderSession::~BlenderSession()
 
 void BlenderSession::create_session()
 {
-       SceneParams scene_params = BlenderSync::get_scene_params(b_scene);
+       SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background);
        SessionParams session_params = BlenderSync::get_session_params(b_scene, background);
 
        /* reset status/progress */
@@ -152,7 +152,7 @@ void BlenderSession::write_render_result()
 void BlenderSession::synchronize()
 {
        /* on session/scene parameter changes, we recreate session entirely */
-       SceneParams scene_params = BlenderSync::get_scene_params(b_scene);
+       SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background);
        SessionParams session_params = BlenderSync::get_session_params(b_scene, background);
 
        if(session->params.modified(session_params) ||
index d44fc3f29ca7092255aa071b57ace9641e8da995..36cf29de12885f31a3b845e45426c35c53f11828 100644 (file)
@@ -210,7 +210,7 @@ void BlenderSync::sync_render_layer(BL::SpaceView3D b_v3d)
 
 /* Scene Parameters */
 
-SceneParams BlenderSync::get_scene_params(BL::Scene b_scene)
+SceneParams BlenderSync::get_scene_params(BL::Scene b_scene, bool background)
 {
        SceneParams params;
        PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
@@ -221,7 +221,11 @@ SceneParams BlenderSync::get_scene_params(BL::Scene b_scene)
        else if(shadingsystem == 1)
                params.shadingsystem = SceneParams::OSL;
        
-       params.bvh_type = (SceneParams::BVHType)RNA_enum_get(&cscene, "debug_bvh_type");
+       if(background)
+               params.bvh_type = SceneParams::BVH_STATIC;
+       else
+               params.bvh_type = (SceneParams::BVHType)RNA_enum_get(&cscene, "debug_bvh_type");
+
        params.use_bvh_spatial_split = RNA_boolean_get(&cscene, "debug_use_spatial_splits");
 
        return params;
index 48e755b3dcd841e7715e317d2755b85f98dd14c3..2e7b8ed253d3d5bf1132886aeda49657da9f36f9 100644 (file)
@@ -59,7 +59,7 @@ public:
        void sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height);
 
        /* get parameters */
-       static SceneParams get_scene_params(BL::Scene b_scene);
+       static SceneParams get_scene_params(BL::Scene b_scene, bool background);
        static SessionParams get_session_params(BL::Scene b_scene, bool background);
        static bool get_session_pause(BL::Scene b_scene, bool background);