diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-01 12:22:24 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-01 17:40:19 +0300 |
commit | be05abc86af49e1f5d6947c01a47ba59586ebf50 (patch) | |
tree | 37d7314d41102011ab81a4046ac6b4da309cfb09 /source/blender | |
parent | 65ec7ec524e667ec95ce947a95f6273088dffee6 (diff) |
Depsgraph: Add some sanity checks to ensure valid relations
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index aee61e22ebc..c96ccbc3696 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -912,23 +912,21 @@ void DepsgraphRelationBuilder::build_object_pointcache(Object *object) int handled_components = 0; LISTBASE_FOREACH (PTCacheID *, ptcache_id, &ptcache_id_list) { /* Check which components needs the point cache. */ - int flag; + int flag = -1; if (ptcache_id->type == PTCACHE_TYPE_RIGIDBODY) { flag = FLAG_TRANSFORM; - ComponentKey transform_key(&object->id, - NodeType::TRANSFORM); + ComponentKey transform_key(&object->id, NodeType::TRANSFORM); add_relation(point_cache_key, transform_key, "Point Cache -> Rigid Body"); } else { flag = FLAG_GEOMETRY; - ComponentKey geometry_key(&object->id, - NodeType::GEOMETRY); - add_relation(point_cache_key, - geometry_key, - "Point Cache -> Geometry"); + ComponentKey geometry_key(&object->id, NodeType::GEOMETRY); + add_relation( + point_cache_key, geometry_key, "Point Cache -> Geometry"); } + BLI_assert(flag != -1); /* Tag that we did handle that component. */ handled_components |= flag; if (handled_components == FLAG_ALL) { |