Page MenuHome
Paste P2941

T96289
ActivePublic

Authored by Sybren A. Stüvel (sybren) on May 12 2022, 5:15 PM.
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 23147b63e27..46755587095 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1693,6 +1693,17 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
continue;
}
add_relation(variable_exit_key, driver_key, "RNA Target -> Driver");
+
+ /* Ensure the RNA getter for `object.data`, which can write to the mesh
+ * datablock, actually can be called when the driver is evaluated. See
+ * T96289 for more info. */
+ if (object != nullptr && object->type == OB_MESH) {
+ StringRef rna_path(dtar->rna_path);
+ if (rna_path == "data" || rna_path.startswith("data.")) {
+ ComponentKey ob_key(target_id, NodeType::GEOMETRY);
+ add_relation(ob_key, driver_key, "ID -> Driver");
+ }
+ }
}
else {
/* If rna_path is nullptr, and DTAR_FLAG_STRUCT_REF isn't set, this

Event Timeline