Here is a quick script I did to quickly delete a few vertex groups at once
very simple to use, just run the script.
a screen will appear listing all the vertex groups, select the ones you want to delete and press the delete button
thats it…
#!BPY
"""
Name: 'Delete Vertex Groups'
Blender: 248
Group: 'Mesh'
Tooltip: 'Batch Delete Vertex Groups'
"""
__author__ = "Brad Gonsalves AKA AVE"
__url__ = ["blenderartists.org", "www.blender.org"]
__version__ = "1.0 2009/06/09"
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender
from Blender import Draw, BGL, Scene, Mesh, Window, sys, Object
import bpy
GroupList=[]
ToggleState=[]
VGListRunning=1
co=[0,0]
GEventNumBase=20
VGColumns=4
GError=False
scn = Scene.GetCurrent()
obj= scn.getActiveObject()
if obj.getType()!='Mesh':
obj= None
sel= [ob for ob in Object.GetSelected() if ob.getType()=='Mesh' if ob != obj]
if not sel and not obj:
Draw.PupMenu('Error, select a mesh as your active object')
GError=True
else:
me = obj.getData(mesh=1)
InEditMode = Window.EditMode()
co=Window.GetMouseCoords()
Window.EditMode(0)
Window.EditMode(1)
def ToggleButton(event, val):
global ToggleState
global VGListRunning
Found=False
for x in ToggleState:
if x[0]==event:
Found=True
x[1]=val
if Found==False:
ToggleState.append([event,val])
VGListRunning=1
def FindToggleState(event):
Found=False
for x in ToggleState:
if x[0]==event:
Found=True
return(x[1])
if Found==False:
return(0)
def DeleteVGroups(event, val):
global VGListRunning
Window.EditMode(0)
if event==1:
EventNum=GEventNumBase
for x in GroupList:
Toggle=FindToggleState(EventNum)
if Toggle:
me.removeVertGroup(x)
EventNum+=1
VGListRunning=0
def buttons():
global GroupList
global co
global VGListRunning
global GEventNumBase
ColHeight=20
ColWidth=105
GroupList=me.getVertGroupNames()
EventNum=GEventNumBase
if len(GroupList)<VGColumns:
CenWidth=0
CenHeight=0
else:
CenWidth=(VGColumns*ColWidth)/2
CenHeight=((len(GroupList)/VGColumns)*ColHeight)/2
BaseCoX=co[0]-CenWidth
BaseCoY=co[1]+CenHeight
coY=BaseCoY
coX=BaseCoX
for x in GroupList:
Toggle=FindToggleState(EventNum)
Draw.Toggle(x,EventNum,coX,coY,100,15,Toggle, "Delete: "+x,ToggleButton)
coX+=ColWidth
EventNum+=1
if coX>=BaseCoX+(ColWidth*VGColumns):
coX=BaseCoX
coY-=ColHeight
if coX!=BaseCoX:
coY-=ColHeight
Draw.PushButton("Delete", 1, BaseCoX, coY, 100, 15,"Delete all selected Vertex Groups", DeleteVGroups)
VGListRunning=0
def main():
if GError: return
while VGListRunning == 1:
Draw.UIBlock(buttons, 0)
Window.EditMode(1)
Window.EditMode(0)
if InEditMode:
Window.EditMode(1)
if __name__ == '__main__':
main()
(by the way if you want to change the number of columns that the vertex groups are displayed in, just change the item
VGColumns=4 right near the top of the script to what ever number you want)