From 0efb7a202ecf1faf0493af32f0fe4d04588c79d5 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 23 Mar 2023 15:51:29 +0100 Subject: [PATCH] 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 --- .../intern/builder/deg_builder_relations.cc | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 31023b8ca4a..c704e73b21d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -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;