Fix: Depsgraph: Avoid duplicated operation nodes on geometry data

Move the geometry shading add_operation_node call to
build_object_geometry_datablock.
Avoids triggering an assertion when the same geometry data is shared
by multiple objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/115615
This commit is contained in:
Miguel Pozo
2023-12-01 16:26:10 +01:00
parent f3ce0645e4
commit f3aab25393

View File

@@ -1664,9 +1664,6 @@ void DepsgraphNodeBuilder::build_object_data_geometry(Object *object)
NodeType::BATCH_CACHE,
OperationCode::GEOMETRY_SELECT_UPDATE,
[object_cow](::Depsgraph *depsgraph) { BKE_object_select_update(depsgraph, object_cow); });
/* Shading (No-Op).
* Needed to allow the Material shading updates reach the Object. */
add_operation_node((ID *)object->data, NodeType::SHADING, OperationCode::SHADING);
}
void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata)
@@ -1795,6 +1792,9 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata)
[obdata_cow](::Depsgraph *depsgraph) {
BKE_object_data_select_update(depsgraph, obdata_cow);
});
/* Shading (No-Op).
* Needed to allow the Material shading updates reach the Object. */
add_operation_node(obdata, NodeType::SHADING, OperationCode::SHADING);
}
void DepsgraphNodeBuilder::build_armature(bArmature *armature)