Fix T96822: Cycles motion blur + persistent data not updating properly

At the frame before/after an object starts moving, it's transform may not be
modified but its motion would be and requires an update.
This commit is contained in:
Brecht Van Lommel 2022-05-03 21:54:18 +02:00
parent 947f8ba300
commit 94205e1d02
Notes: blender-bot 2023-02-14 00:06:52 +01:00
Referenced by issue #99281, Animated curves flickers when Motion Blur and Persistent Data are enabled
Referenced by issue #96822, Persistent Data Causes Render Errors for Motion Blur
Referenced by issue #95475, Cycles: Motion blur causing some frames to render objects incorrectly
1 changed files with 2 additions and 2 deletions

View File

@ -220,7 +220,7 @@ void Object::tag_update(Scene *scene)
}
if (geometry) {
if (tfm_is_modified()) {
if (tfm_is_modified() || motion_is_modified()) {
flag |= ObjectManager::TRANSFORM_MODIFIED;
}
@ -480,7 +480,7 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s
kobject.motion_offset = state->motion_offset[ob->index];
/* Decompose transforms for interpolation. */
if (ob->tfm_is_modified() || update_all) {
if (ob->tfm_is_modified() || ob->motion_is_modified() || update_all) {
DecomposedTransform *decomp = state->object_motion + kobject.motion_offset;
transform_motion_decompose(decomp, ob->motion.data(), ob->motion.size());
}