Fix T62938: Rigid body crash with surface effector

Missing dependency graph relation from geometry to simulation,
which made simulation to use evaluated mesh while it is being
evaluated.
This commit is contained in:
Sergey Sharybin
2019-03-29 10:27:57 +01:00
parent 9f55beb971
commit 1def03d797

View File

@@ -1738,6 +1738,15 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene)
ComponentKey effector_transform_key(
&effector_relation->ob->id, NodeType::TRANSFORM);
add_relation(effector_transform_key, rb_init_key, "RigidBody Field");
if (effector_relation->pd != NULL) {
const short shape = effector_relation->pd->shape;
if (ELEM(shape, PFIELD_SHAPE_SURFACE, PFIELD_SHAPE_POINTS)) {
ComponentKey effector_geometry_key(
&effector_relation->ob->id, NodeType::GEOMETRY);
add_relation(
effector_geometry_key, rb_init_key, "RigidBody Field");
}
}
}
/* Objects. */
if (rbw->group != NULL) {