[Bf-blender-cvs] [7ed9d1b] master: Fix T39523: cycles cache BVH not working correct with deformation motion blur.

Brecht Van Lommel noreply at git.blender.org
Wed Apr 2 20:51:34 CEST 2014


Commit: 7ed9d1b402c5d2a8d783a029ab2e4695cec88a05
Author: Brecht Van Lommel
Date:   Wed Apr 2 17:06:23 2014 +0200
https://developer.blender.org/rB7ed9d1b402c5d2a8d783a029ab2e4695cec88a05

Fix T39523: cycles cache BVH not working correct with deformation motion blur.

===================================================================

M	intern/cycles/bvh/bvh.cpp

===================================================================

diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index 770393c..3c0c5c0 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -77,13 +77,25 @@ bool BVH::cache_read(CacheData& key)
 	key.add(&params, sizeof(params));
 
 	foreach(Object *ob, objects) {
-		key.add(ob->mesh->verts);
-		key.add(ob->mesh->triangles);
-		key.add(ob->mesh->curve_keys);
-		key.add(ob->mesh->curves);
+		Mesh *mesh = ob->mesh;
+
+		key.add(mesh->verts);
+		key.add(mesh->triangles);
+		key.add(mesh->curve_keys);
+		key.add(mesh->curves);
 		key.add(&ob->bounds, sizeof(ob->bounds));
 		key.add(&ob->visibility, sizeof(ob->visibility));
-		key.add(&ob->mesh->transform_applied, sizeof(bool));
+		key.add(&mesh->transform_applied, sizeof(bool));
+
+		if(mesh->use_motion_blur) {
+			Attribute *attr = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
+			if(attr)
+				key.add(attr->buffer);
+
+			attr = mesh->curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
+			if(attr)
+				key.add(attr->buffer);
+		}
 	}
 
 	CacheData value;




More information about the Bf-blender-cvs mailing list