Fix T88216: Cycles persistent data fails with animated object transform in instance

This commit is contained in:
Brecht Van Lommel 2021-05-17 15:43:42 +02:00
parent 88e884bfc6
commit e48cdf3d0d
Notes: blender-bot 2023-02-14 02:13:08 +01:00
Referenced by issue #88216, persistent data causes collection instance animation to not work properly
1 changed files with 3 additions and 6 deletions

View File

@ -261,10 +261,8 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
}
/* test if we need to sync */
bool object_updated = false;
if (object_map.add_or_update(&object, b_ob, b_parent, key))
object_updated = true;
bool object_updated = object_map.add_or_update(&object, b_ob, b_parent, key) ||
(tfm != object->get_tfm());
/* mesh sync */
/* b_ob is owned by the iterator and will go out of scope at the end of the block.
@ -313,8 +311,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
* transform comparison should not be needed, but duplis don't work perfect
* in the depsgraph and may not signal changes, so this is a workaround */
if (object->is_modified() || object_updated ||
(object->get_geometry() && object->get_geometry()->is_modified()) ||
tfm != object->get_tfm()) {
(object->get_geometry() && object->get_geometry()->is_modified())) {
object->name = b_ob.name().c_str();
object->set_pass_id(b_ob.pass_index());
object->set_color(get_float3(b_ob.color()));