Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2020-09-01 12:39:09 +0300
committerSebastian Parborg <darkdefende@gmail.com>2020-09-01 12:41:44 +0300
commite8be55a4859ac87b215268558e6ee9328033f183 (patch)
treedec5f13faaa4e50cf65dbb7f03f07198bd42d1ab /source/blender/depsgraph
parentc2df6658ee9488f473cd5042c89ef6771ada6024 (diff)
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.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc6
2 files changed, 5 insertions, 3 deletions
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);