diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-03-12 19:33:46 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-03-12 19:37:29 +0300 |
commit | 17793a66c684aa86559de90d4cb5af7e65a06f66 (patch) | |
tree | 808170916259f6934d8aad1682eab18754e93e6d | |
parent | 44aa86b0a55cbeaa1a5cd8f6f420f1287fe7c9f4 (diff) |
Fix T54299: crash rendering objects with motion blur disabled, after recent changes.
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 4b40f4d458b..077ceb4ebef 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -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)); + } } } |