Fix T62104: VertexGroup.add() doesn't push depsgraph update for the mesh.

When adding and removing weights from the python api, no depsgraph
updates were triggered.  This would cause the mesh geometry to be out of
sync in the viewport if there were any modifiers that used the vertex
groups in question.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D4439
This commit is contained in:
Sebastian Parborg 2019-03-09 11:45:31 +01:00
parent fede272d2c
commit 36cd31060b
Notes: blender-bot 2023-02-14 08:47:25 +01:00
Referenced by issue #62104, VertexGroup.add() doesn't push depsgraph update for the mesh.
1 changed files with 2 additions and 0 deletions

View File

@ -1474,6 +1474,7 @@ static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *re
while (index_len--)
ED_vgroup_vert_add(ob, def, *index++, weight, assignmode); /* XXX, not efficient calling within loop*/
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
WM_main_add_notifier(NC_GEOM | ND_DATA, (ID *)ob->data);
}
@ -1489,6 +1490,7 @@ static void rna_VertexGroup_vertex_remove(ID *id, bDeformGroup *dg, ReportList *
while (index_len--)
ED_vgroup_vert_remove(ob, dg, *index++);
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
WM_main_add_notifier(NC_GEOM | ND_DATA, (ID *)ob->data);
}