Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2022-05-16 19:17:37 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-05-16 19:17:37 +0300
commit4be79da9a73627b8f8666503e1610090b28b96a8 (patch)
tree650cfe337b736e70f3c72982ba608e342aca714e /source/blender/depsgraph
parentb8c30fb80a24ba87a7443364a1737ae636fbf6bf (diff)
parenta2dacefb46363cac5abd7d0d5dcbf9ff2764bef7 (diff)
Merge remote-tracking branch 'origin/blender-v3.2-release'
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 23147b63e27..5eccb5a4eb2 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1693,6 +1693,22 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
continue;
}
add_relation(variable_exit_key, driver_key, "RNA Target -> Driver");
+
+ /* The RNA getter for `object.data` can write to the mesh datablock due
+ * to the call to `BKE_mesh_wrapper_ensure_subdivision()`. This relation
+ * ensures it is safe to call when the driver is evaluated.
+ *
+ * For the sake of making the code more generic/defensive, the relation
+ * is added for any geometry type.
+ *
+ * See T96289 for more info. */
+ if (object != nullptr && OB_TYPE_IS_GEOMETRY(object->type)) {
+ 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