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:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-06-15 18:14:48 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-06-15 18:15:42 +0300
commited3d693cb181c21c8d00b6d2aa734e25c2d65cda (patch)
treee44c3ea635efd5ee6c3b694bd856eb8f7d5de7a3 /source/blender/depsgraph/intern/builder/deg_builder_relations.cc
parent43d22d80e72d1a1bf49d33fc4f8bd1a031e3358b (diff)
Dependency graph fixes for RigidBodyWorld
- rbw->group added to the depsgraph. - Mesh evaluation added when necessary. - Prevent of double-free by freeing the scene before objects.
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_relations.cc')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 5312c7adac8..bc8528f6738 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1426,6 +1426,8 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene)
/* objects - simulation participants */
if (rbw->group) {
+ build_collection(DEG_COLLECTION_OWNER_OBJECT, NULL, rbw->group);
+
FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->group, object)
{
if (object->type != OB_MESH) {
@@ -1447,6 +1449,13 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene)
add_relation(sim_key, rbo_key, "Rigidbody Sim Eval -> RBO Sync");
+ /* Geometry must be known to create the rigid body. RBO_MESH_BASE uses the non-evaluated
+ * mesh, so then the evaluation is unnecessary. */
+ if (object->rigidbody_object->mesh_source != RBO_MESH_BASE) {
+ ComponentKey geom_key(&object->id, DEG_NODE_TYPE_GEOMETRY);
+ add_relation(geom_key, init_key, "Object Geom Eval -> Rigidbody Rebuild");
+ }
+
/* if constraints exist, those depend on the result of the rigidbody sim
* - This allows constraints to modify the result of the sim (i.e. clamping)
* while still allowing the sim to depend on some changes to the objects.