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:
authorSergey Sharybin <sergey@blender.org>2022-11-03 17:48:54 +0300
committerSergey Sharybin <sergey@blender.org>2022-11-03 18:52:11 +0300
commit2c0c43139962ee43db7235d39db22ec77d3349f3 (patch)
treed01b5101b42ccfb7a0709e0449da19f9237dc9bc
parente449bf350c94bebd7a198b3327860da89bd490d8 (diff)
Fix T102221: Entering editmode invalidates the driver associated with that mesh
The regression is caused by D13824 0f89bcdbebf5. This fix follows the code from Sybren (D7785) to make object-mode drivers from shapekey value to work. This intuitively makes sense since the D13824 made the edit mode evaluation and ownership follow the object mode more closely. Differential Revision: https://developer.blender.org/D16380
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc b/source/blender/blenkernel/intern/DerivedMesh.cc
index 97ff45e93ce..bfdfc447baf 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.cc
+++ b/source/blender/blenkernel/intern/DerivedMesh.cc
@@ -1648,6 +1648,12 @@ static void editbmesh_build_data(struct Depsgraph *depsgraph,
const bool is_mesh_eval_owned = (me_final != mesh->runtime->mesh_eval);
BKE_object_eval_assign_data(obedit, &me_final->id, is_mesh_eval_owned);
+ /* Make sure that drivers can target shapekey properties.
+ * Note that this causes a potential inconsistency, as the shapekey may have a
+ * different topology than the evaluated mesh. */
+ BLI_assert(mesh->key == nullptr || DEG_is_evaluated_id(&mesh->key->id));
+ me_final->key = mesh->key;
+
obedit->runtime.editmesh_eval_cage = me_cage;
obedit->runtime.geometry_set_eval = non_mesh_components;