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:
authorCampbell Barton <ideasman42@gmail.com>2012-09-03 04:02:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-03 04:02:13 +0400
commitdbdd1bb4f2071975bd9218fc7990354b226d6061 (patch)
tree6fdf89c44fef5a5387bde2a7cf2976ce337682b0 /source/blender
parentc9cd150f4352837e07ab58135b73a3d87a32244c (diff)
remove vertex groups from a mesh or lattice when this there are no remaining vertex groups. This was dont in edit-mode but not object-mode.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/object/object_vgroup.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index d08237ed09a..b13a299c4c7 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -1786,6 +1786,21 @@ static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg)
if (ob->actdef < 1 && ob->defbase.first)
ob->actdef = 1;
+ /* remove all dverts */
+ if (ob->defbase.first == NULL) {
+ if (ob->type == OB_MESH) {
+ Mesh *me = ob->data;
+ CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert);
+ me->dvert = NULL;
+ }
+ else if (ob->type == OB_LATTICE) {
+ Lattice *lt = ob->data;
+ if (lt->dvert) {
+ MEM_freeN(lt->dvert);
+ lt->dvert = NULL;
+ }
+ }
+ }
}
/* only in editmode */