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.
This commit is contained in:
Sergey Sharybin
2015-09-04 15:19:22 +05:00
parent 3e63c604e3
commit 52fda9b0db

View File

@@ -842,6 +842,7 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Object *object, float motion
return; return;
} }
/* TODO(sergey): Perform preliminary check for number of verticies. */
if(numverts) { if(numverts) {
/* find attributes */ /* find attributes */
Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); 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 */ /* in case of new attribute, we verify if there really was any motion */
if(new_attribute) { 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 */ /* no motion, remove attributes again */
VLOG(1) << "No actual deformation motion for object " << b_ob.name(); VLOG(1) << "No actual deformation motion for object " << b_ob.name();
mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION); mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);