Fix T89736: Cycles error with persistent data, displacement and motion blur

This commit is contained in:
Brecht Van Lommel 2021-07-12 15:56:31 +02:00
parent 45a47142fc
commit f709f12d93
Notes: blender-bot 2023-02-14 06:23:08 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #89966, Texture displacement increasing in strength
Referenced by issue #89736, Persistent data, motion blur, and geometry displacement results in glitchy meshes during rendering
Referenced by issue #87903, Holdout collection objects affect transparency of motion blurred objects and cause artifacts
1 changed files with 6 additions and 6 deletions

View File

@ -109,23 +109,23 @@ void BlenderSync::sync_object_motion_init(BL::Object &b_parent, BL::Object &b_ob
}
Geometry *geom = object->get_geometry();
geom->set_use_motion_blur(false);
geom->set_motion_steps(0);
uint motion_steps;
int motion_steps = 0;
bool use_motion_blur = false;
if (need_motion == Scene::MOTION_BLUR) {
motion_steps = object_motion_steps(b_parent, b_ob, Object::MAX_MOTION_STEPS);
geom->set_motion_steps(motion_steps);
if (motion_steps && object_use_deform_motion(b_parent, b_ob)) {
geom->set_use_motion_blur(true);
use_motion_blur = true;
}
}
else {
motion_steps = 3;
geom->set_motion_steps(motion_steps);
}
geom->set_use_motion_blur(use_motion_blur);
geom->set_motion_steps(motion_steps);
motion.resize(motion_steps, transform_empty());
if (motion_steps) {