Fix for Cycles particle motion blur hiding fix.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 5 Aug 2016 22:38:23 +0000 (00:38 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 5 Aug 2016 23:14:32 +0000 (01:14 +0200)
My mistake in modifying the patch.

intern/cycles/render/object.cpp

index 7024a8bcc79664be8eb99be9d07bf2567549da43..5dbe2e4d6a12824f012a3631d7f2d1bf29abc633 100644 (file)
@@ -55,9 +55,9 @@ Object::Object()
        particle_system = NULL;
        particle_index = 0;
        bounds = BoundBox::empty;
-       motion.pre = transform_identity();
-       motion.mid = transform_identity();
-       motion.post = transform_identity();
+       motion.pre = transform_empty();
+       motion.mid = transform_empty();
+       motion.post = transform_empty();
        use_motion = false;
 }
 
@@ -346,6 +346,15 @@ void ObjectManager::device_update_object_transform(UpdateObejctTransformState *s
                Transform mtfm_pre = ob->motion.pre;
                Transform mtfm_post = ob->motion.post;
 
+               /* In case of missing motion information for previous/next frame,
+                * assume there is no motion. */
+               if(!ob->use_motion || mtfm_pre == transform_empty()) {
+                       mtfm_pre = ob->tfm;
+               }
+               if(!ob->use_motion || mtfm_post == transform_empty()) {
+                       mtfm_post = ob->tfm;
+               }
+
                if(!mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION)) {
                        mtfm_pre = mtfm_pre * itfm;
                        mtfm_post = mtfm_post * itfm;