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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-03-21 16:38:35 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-03-21 16:41:41 +0300
commit2b21e7ab9a14cfa1d9e42b97d8056c3b0050fcc9 (patch)
tree626705708835680b20b3f34f6838ab1828b28bc0 /source/blender/depsgraph
parentb832f6f9150eda34e85974756a591e750b13c83e (diff)
Fix T62768: Softbody cache still not updated correctly
There was missing flush from transform update to the point cache reset. Caused by the fact that when update happens in the "middle" of component all the component operations will be tagged for update (since the intermediate state is not stored), but that will not flush updates to other operations since that would cause too much of updates. This now we tag point cache for reset after evaluation operation but before final transform and before rigid body world.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc8
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc35
2 files changed, 28 insertions, 15 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 39806d22071..f0d0656f254 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -778,6 +778,11 @@ void DepsgraphNodeBuilder::build_object_transform(Object *object)
function_bind(BKE_object_eval_uber_transform,
_1,
ob_cow));
+ /* Operation to take of rigid body simulation. soft bodies and other firends
+ * in the context of point cache invalidation. */
+ add_operation_node(&object->id,
+ NodeType::TRANSFORM,
+ OperationCode::TRANSFORM_SIMULATION_INIT);
/* Object transform is done. */
op_node = add_operation_node(&object->id, NodeType::TRANSFORM,
OperationCode::TRANSFORM_FINAL,
@@ -1072,9 +1077,6 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
if (object->type != OB_MESH) {
continue;
}
- add_operation_node(&object->id,
- NodeType::TRANSFORM,
- OperationCode::TRANSFORM_SIMULATION_INIT);
/* Create operation for flushing results. */
/* Object's transform component - where the rigidbody operation
* lives. */
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 38f54c70874..49f1f93ed6c 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -636,6 +636,10 @@ void DepsgraphRelationBuilder::build_object(Base *base, Object *object)
BKE_constraints_id_loop(&object->constraints, constraint_walk, &data);
}
/* Object constraints. */
+ OperationKey object_transform_simulation_init_key(
+ &object->id,
+ NodeType::TRANSFORM,
+ OperationCode::TRANSFORM_SIMULATION_INIT);
if (object->constraints.first != NULL) {
OperationKey constraint_key(&object->id,
NodeType::TRANSFORM,
@@ -649,12 +653,22 @@ void DepsgraphRelationBuilder::build_object(Base *base, Object *object)
/* operation order */
add_relation(base_op_key, constraint_key, "ObBase-> Constraint Stack");
add_relation(constraint_key, final_transform_key, "ObConstraints -> Done");
- add_relation(constraint_key, ob_eval_key, "Eval");
- add_relation(ob_eval_key, final_transform_key, "Eval");
+ add_relation(constraint_key, ob_eval_key, "Constraint -> Transform Eval");
+ add_relation(ob_eval_key,
+ object_transform_simulation_init_key,
+ "Transform Eval -> Simulation Init");
+ add_relation(object_transform_simulation_init_key,
+ final_transform_key,
+ "Simulation -> Final Transform");
}
else {
add_relation(base_op_key, ob_eval_key, "Eval");
- add_relation(ob_eval_key, final_transform_key, "Eval");
+ add_relation(ob_eval_key,
+ object_transform_simulation_init_key,
+ "Transform Eval -> Simulation Init");
+ add_relation(object_transform_simulation_init_key,
+ final_transform_key,
+ "Simulation -> Final Transform");
}
/* Animation data */
build_animdata(&object->id);
@@ -959,15 +973,16 @@ void DepsgraphRelationBuilder::build_object_pointcache(Object *object)
}
/* Manual edits to any dependency (or self) should reset the point cache. */
if (!BLI_listbase_is_empty(&ptcache_id_list)) {
- OperationKey transform_init_key(&object->id,
- NodeType::TRANSFORM,
- OperationCode::TRANSFORM_INIT);
+ OperationKey transform_simulation_init_key(
+ &object->id,
+ NodeType::TRANSFORM,
+ OperationCode::TRANSFORM_SIMULATION_INIT);
OperationKey geometry_init_key(&object->id,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL_INIT);
- add_relation(transform_init_key,
+ add_relation(transform_simulation_init_key,
point_cache_key,
- "Transform Local -> Point Cache",
+ "Transform Simulation -> Point Cache",
RELATION_FLAG_FLUSH_USER_EDIT_ONLY);
add_relation(geometry_init_key,
point_cache_key,
@@ -1740,10 +1755,6 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene)
&object->id,
NodeType::TRANSFORM,
OperationCode::TRANSFORM_EVAL);
-
- add_relation(object_transform_eval_key,
- object_transform_simulation_init_key,
- "Object Transform -> Simulation Init");
add_relation(object_transform_simulation_init_key,
rb_simulate_key,
"Object Transform -> Rigidbody Sim Eval");