[Bf-blender-cvs] [36cd31060b6] master: Fix T62104: VertexGroup.add() doesn't push depsgraph update for the mesh.

Sebastian Parborg noreply at git.blender.org
Sat Mar 9 11:48:40 CET 2019


Commit: 36cd31060b6db6a81668996757bf166cfff38a22
Author: Sebastian Parborg
Date:   Sat Mar 9 11:45:31 2019 +0100
Branches: master
https://developer.blender.org/rB36cd31060b6db6a81668996757bf166cfff38a22

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

===================================================================

M	source/blender/makesrna/intern/rna_object.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 622a4b7c01b..f320ce925ff 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -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);
 }



More information about the Bf-blender-cvs mailing list