All pastes #575644 Raw Edit

Delete All Vertex Groups in Blen

public python v1 · immutable
·published 2007-06-19 04:01 UTC
rendered paste body
from Blender import Scene, Mesh, Window, sysimport BPyMessagesimport bpydef my_mesh_util(me):		print '-'*100	print 'Removing all vertex groups in "%s" mesh\n' % me.name	VGroups = me.getVertGroupNames()		for i in VGroups:		me.removeVertGroup(i)		print 'Vertex Group "%s" Removed!' % i		def main():		sce = bpy.data.scenes.active		ob_act = sce.objects.active		if not ob_act or ob_act.type != 'Mesh':		BPyMessages.Error_NoMeshActive()		return		is_editmode = Window.EditMode()	if is_editmode: Window.EditMode(0)		Window.WaitCursor(1)	me = ob_act.getData(mesh=1)	t = sys.time()		my_mesh_util(me)		if is_editmode: Window.EditMode(1)			print '\nExecution time: %.2f seconds' % (sys.time()-t)	Window.WaitCursor(0)if __name__ == '__main__':	main()print '-'*100