Fix #105954: RIGIDBODY_REBUILD failure on rendering

Happens if a scene has a PointerProperty of type collection which
is set to a collection containing rigid bodies.

The error is printed by the builder of the render pipeline graph,
which contains very minimal subset of the view layer: it includes
custom properties (which gets recursed into), but not the rigid
body simulation.

This fix is mainly suppressing the error print, without changing
the apparent behavior of the graph.

Pull Request: https://projects.blender.org/blender/blender/pulls/106045
This commit is contained in:
Sergey Sharybin 2023-03-23 15:51:29 +01:00 committed by Sergey Sharybin
parent a2827af0aa
commit 0efb7a202e

@ -1164,13 +1164,19 @@ void DepsgraphRelationBuilder::build_object_pointcache(Object *object)
OperationKey transform_key(
&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_SIMULATION_INIT);
add_relation(point_cache_key, transform_key, "Point Cache -> Rigid Body");
/* Manual changes to effectors need to invalidate simulation. */
OperationKey rigidbody_rebuild_key(
&scene_->id, NodeType::TRANSFORM, OperationCode::RIGIDBODY_REBUILD);
add_relation(rigidbody_rebuild_key,
point_cache_key,
"Rigid Body Rebuild -> Point Cache Reset",
RELATION_FLAG_FLUSH_USER_EDIT_ONLY);
/* Manual changes to effectors need to invalidate simulation.
*
* Don't add this relation for the render pipeline dependency graph as it does not contain
* rigid body simulation. Good thing is that there are no user edits in such dependency
* graph, so the relation is not really needed in it. */
if (!graph_->is_render_pipeline_depsgraph) {
OperationKey rigidbody_rebuild_key(
&scene_->id, NodeType::TRANSFORM, OperationCode::RIGIDBODY_REBUILD);
add_relation(rigidbody_rebuild_key,
point_cache_key,
"Rigid Body Rebuild -> Point Cache Reset",
RELATION_FLAG_FLUSH_USER_EDIT_ONLY);
}
}
else {
flag = FLAG_GEOMETRY;