Fix #19618: invalid vertex group data could be created when
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 19 Oct 2009 17:11:42 +0000 (17:11 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 19 Oct 2009 17:11:42 +0000 (17:11 +0000)
assign vertices without an existing vertex group, causing e.g.
armature modifiers to crash.

release/scripts/ui/buttons_data_mesh.py
source/blender/editors/object/object_vgroup.c

index 76c66f7aecedb5445b4a835cd32aa2e557fc2d00..3c8f655f17aa4b794d52ab8db67ee238a8debf36 100644 (file)
@@ -88,7 +88,7 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
                        row = layout.row()
                        row.itemR(group, "name")
 
-               if ob.mode == 'EDIT':
+               if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
                        row = layout.row()
                        
                        sub = row.row(align=True)
index dd3e5969a75308d55fb2e661a475b808b11935a3..0de1c79b796f8b5d31579451a15bf08fe9cc8283 100644 (file)
@@ -876,6 +876,8 @@ static void vgroup_assign_verts(Object *ob, float weight)
        int     i, done;
 
        dg=BLI_findlink(&ob->defbase, ob->actdef-1);
+       if(!dg)
+               return;
 
        if(ob->type == OB_MESH) {
                Mesh *me= ob->data;