Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-04-02 19:06:23 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-04-02 22:51:29 +0400
commit7ed9d1b402c5d2a8d783a029ab2e4695cec88a05 (patch)
tree9ea32e36ecad36e09dc3a6b268c75b1b6c20e768 /intern/cycles/bvh/bvh.cpp
parent8c730b1059032f45da06c278715909b71009909c (diff)
Fix T39523: cycles cache BVH not working correct with deformation motion blur.
Diffstat (limited to 'intern/cycles/bvh/bvh.cpp')
-rw-r--r--intern/cycles/bvh/bvh.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index 770393c9f21..3c0c5c021c8 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;