Fix assert on vertex parent

The evaluation was done on an original object, which is not allowed.
This commit is contained in:
Sergey Sharybin 2019-03-20 17:19:26 +01:00
parent afd9e87f8d
commit 15d6521de9
Notes: blender-bot 2023-02-14 07:31:34 +01:00
Referenced by issue #59352, Make Vertex Parent - the constrained object shifts after parenting
1 changed files with 6 additions and 3 deletions

View File

@ -151,9 +151,12 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
EDBM_mesh_normals_update(em);
BKE_editmesh_tessface_calc(em);
/* derivedMesh might be needed for solving parenting,
* so re-create it here */
makeDerivedMesh(depsgraph, scene, obedit, em, &CD_MASK_BAREMESH_ORIGINDEX, false);
/* Make sure the evaluated mesh is updates.
*
* Most reliable way is to update the tagged objects, which will ensure
* proper copy-on-write update, but also will make sure all dependent
* objects are also up to date. */
BKE_scene_graph_update_tagged(depsgraph, bmain);
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {