Depsgraph: Fix missing point cache reset when physics changes
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Nov 2018 10:24:54 +0000 (11:24 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Nov 2018 13:08:39 +0000 (14:08 +0100)
commitd3c08b1aa62d0e6b373621cbd2da7342796f9625
treee15edd7504ebb004611dff1fa2b283d306f88748
parent1d8db50538c4ba933d0a5faf97807ace1a9f6386
Depsgraph: Fix missing point cache reset when physics changes

Among all the lines moved around, the general idea is quite simple.
Actually, there are two ideas implemented there.

First one, is when object itself is tagged for update, we tag its
point cache component for evaluation, which makes it so point cache
is properly reset. We do it implicitly because otherwise we'll need
to go everywhere and add explicit tag in almost all the properties.

Second thing is, we link all collider and force fields to a point
cache component using special type of link. This type of link only
allows flush if change is caused by a user update. This way reset
does not happen when change is caused due to animation, but will
properly happen when user causes indirect change to the objects
which are part of physics simulation.
26 files changed:
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/object_update.c
source/blender/depsgraph/DEG_depsgraph.h
source/blender/depsgraph/DEG_depsgraph_build.h
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_nodes.h
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.h
source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
source/blender/depsgraph/intern/depsgraph.h
source/blender/depsgraph/intern/depsgraph_build.cc
source/blender/depsgraph/intern/depsgraph_eval.cc
source/blender/depsgraph/intern/depsgraph_physics.cc
source/blender/depsgraph/intern/depsgraph_tag.cc
source/blender/depsgraph/intern/depsgraph_type_defines.cc
source/blender/depsgraph/intern/depsgraph_types.h
source/blender/depsgraph/intern/eval/deg_eval_flush.cc
source/blender/depsgraph/intern/nodes/deg_node.h
source/blender/depsgraph/intern/nodes/deg_node_component.cc
source/blender/depsgraph/intern/nodes/deg_node_component.h
source/blender/depsgraph/intern/nodes/deg_node_id.cc
source/blender/depsgraph/intern/nodes/deg_node_id.h
source/blender/depsgraph/intern/nodes/deg_node_operation.cc
source/blender/depsgraph/intern/nodes/deg_node_operation.h
source/blender/depsgraph/intern/nodes/deg_node_time.cc
source/blender/depsgraph/intern/nodes/deg_node_time.h