diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-09-04 13:19:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-09-04 13:19:22 +0300 |
commit | 52fda9b0dbdc561f905cd691532e361a0254113a (patch) | |
tree | 27942c48a3e1348bfc88b1b4b063e751a2ac63e8 /intern | |
parent | 3e63c604e395f00d2ee81fa48ab1bad29c95a4e7 (diff) |
Fix T45019: Cycles wrong render of motion blur mesh
The issue was caused by wrong detection whether number of verticies
changed or not. Basically, it wasn't working correct in cases when
number of verticies is increasing compared to the current frame.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index e81170ac411..7135e938afb 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -842,6 +842,7 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Object *object, float motion return; } + /* TODO(sergey): Perform preliminary check for number of verticies. */ if(numverts) { /* find attributes */ Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); @@ -873,7 +874,9 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Object *object, float motion /* in case of new attribute, we verify if there really was any motion */ if(new_attribute) { - if(i != numverts || memcmp(mP, &mesh->verts[0], sizeof(float3)*numverts) == 0) { + if(b_mesh.vertices.length() != numverts || + memcmp(mP, &mesh->verts[0], sizeof(float3)*numverts) == 0) + { /* no motion, remove attributes again */ VLOG(1) << "No actual deformation motion for object " << b_ob.name(); mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION); |