[Bf-blender-cvs] [e8be55a4859] master: Fix: Active rigidbodies would not recive updates after the stopped being animated

Sebastian Parborg noreply at git.blender.org
Tue Sep 1 11:41:51 CEST 2020


Commit: e8be55a4859ac87b215268558e6ee9328033f183
Author: Sebastian Parborg
Date:   Tue Sep 1 11:39:09 2020 +0200
Branches: master
https://developer.blender.org/rBe8be55a4859ac87b215268558e6ee9328033f183

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.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===================================================================

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



More information about the Bf-blender-cvs mailing list