Fix T54299: crash rendering objects with motion blur disabled, after recent changes.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 12 Mar 2018 16:33:46 +0000 (17:33 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 12 Mar 2018 16:37:29 +0000 (17:37 +0100)
intern/cycles/blender/blender_object.cpp

index 4b40f4d..077ceb4 100644 (file)
@@ -391,7 +391,7 @@ Object *BlenderSync::sync_object(BL::Object& b_parent,
 
                        if(scene->need_motion() == Scene::MOTION_BLUR) {
                                motion_steps = object_motion_steps(b_parent, b_ob);
-                               if(object_use_deform_motion(b_parent, b_ob)) {
+                               if(motion_steps && object_use_deform_motion(b_parent, b_ob)) {
                                        mesh->motion_steps = motion_steps;
                                        mesh->use_motion_blur = true;
                                }
@@ -402,10 +402,13 @@ Object *BlenderSync::sync_object(BL::Object& b_parent,
                        }
 
                        object->motion.resize(motion_steps, transform_empty());
-                       object->motion[motion_steps/2] = tfm;
 
-                       for(size_t step = 0; step < motion_steps; step++) {
-                               motion_times.insert(object->motion_time(step));
+                       if(motion_steps) {
+                               object->motion[motion_steps/2] = tfm;
+
+                               for(size_t step = 0; step < motion_steps; step++) {
+                                       motion_times.insert(object->motion_time(step));
+                               }
                        }
                }