Fix T60451: Soft body cache not being cleared when it should

Manual edits to object or its dependencies should reset the
point cache. Added special relations for this now.
This commit is contained in:
Sergey Sharybin 2019-02-01 14:05:00 +01:00
parent 97fa7974da
commit 227ed1aa35
Notes: blender-bot 2023-02-14 08:24:03 +01:00
Referenced by issue #60451, Soft body cache not being cleared when it should be in Blender 2.8
1 changed files with 20 additions and 1 deletions

View File

@ -922,7 +922,9 @@ void DepsgraphRelationBuilder::build_object_pointcache(Object *object)
}
else {
flag = FLAG_GEOMETRY;
ComponentKey geometry_key(&object->id, NodeType::GEOMETRY);
OperationKey geometry_key(&object->id,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL);
add_relation(
point_cache_key, geometry_key, "Point Cache -> Geometry");
}
@ -933,6 +935,23 @@ void DepsgraphRelationBuilder::build_object_pointcache(Object *object)
break;
}
}
/* Manual edits to any dependency (or self) should reset the point cache. */
if (!BLI_listbase_is_empty(&ptcache_id_list)) {
OperationKey transform_local_key(&object->id,
NodeType::TRANSFORM,
OperationCode::TRANSFORM_LOCAL);
OperationKey geometry_init_key(&object->id,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL_INIT);
add_relation(transform_local_key,
point_cache_key,
"Transform Local -> Point Cache",
RELATION_FLAG_FLUSH_USER_EDIT_ONLY);
add_relation(geometry_init_key,
point_cache_key,
"Geometry Init -> Point Cache",
RELATION_FLAG_FLUSH_USER_EDIT_ONLY);
}
BLI_freelistN(&ptcache_id_list);
}