From e8be55a4859ac87b215268558e6ee9328033f183 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Tue, 1 Sep 2020 11:39:09 +0200 Subject: Fix: Active rigidbodies would not recive updates after the stopped being animated Because depsgraph isn't rebuild for animated properies, we have to assume that active bodies will always want to have updates from the rigidbody simulation. --- source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 2 +- source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/depsgraph') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 670827dc4d8..6776f4b7b83 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -1130,7 +1130,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) continue; } - if (!BKE_rigidbody_is_affected_by_simulation(object)) { + if (object->rigidbody_object->type == RBO_TYPE_PASSIVE) { continue; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 5f637a92069..14f9db767a9 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1735,10 +1735,12 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) } /* Final transform is whetever solver gave to us. */ - if (BKE_rigidbody_is_affected_by_simulation(object)) { + if (object->rigidbody_object->type == RBO_TYPE_ACTIVE) { /* We do not have to update the objects final transform after the simulation if it is * passive or controlled by the animation system in blender. - * (Bullet doesn't move the object at all in these cases) + * (Bullet doesn't move the object at all in these cases). + * But we can't update the depgraph when the animated property in changed during playback. + * So always assume that active bodies needs updating. */ OperationKey rb_transform_copy_key( &object->id, NodeType::TRANSFORM, OperationCode::RIGIDBODY_TRANSFORM_COPY); -- cgit v1.2.3