Fix T54299: crash rendering objects with motion blur disabled, after recent changes.

This commit is contained in:
Brecht Van Lommel 2018-03-12 17:33:46 +01:00
parent 44aa86b0a5
commit 17793a66c6
Notes: blender-bot 2023-02-14 08:33:26 +01:00
Referenced by issue #54299, Cycles: from buildbot Crash when disable per Object Motion Blur
1 changed files with 7 additions and 4 deletions

View 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));
}
}
}