#!BPY """ Name: 'Remove verts from all vertex groups' Blender: 248.1 Group: 'Mesh' Tooltip: 'Clears selected vertices from all vertex groups for a fresh start' """ __author__ = "Ivo Grigull" __url__ = ["http://www.ivogrigull.com"] __version__ = "0.1" __bpydoc__ = """\ Remove vertices from all vertex groups ----------------------------------------- Menu: Mesh->Remove verts from all vertex groups This Script is to be used in edit mode. Select some vertices and run the script. # -------------------------------------------------------------------------- # ***** 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 import BPyMesh from Blender import Window def main(): in_editmode = Window.EditMode() if in_editmode: Window.EditMode(0) ob = Blender.Object.GetSelected()[0] me = ob.getData(mesh=1) me_verts = me.verts verts_sel= [f for f in me_verts if f.sel] groupNames, vWeightDict= BPyMesh.meshWeight2Dict(me) for n in verts_sel: for b in vWeightDict[n.index].keys(): del vWeightDict[n.index][b] BPyMesh.dict2MeshWeight(me, groupNames, vWeightDict) if in_editmode: Window.EditMode(1) if __name__=='__main__': main()