utility BPAid "Bones Pro Aid"
(
button openfloater "Floater"

rollout Bparollout "BP Aid"
	(
	button expsel "Expand Selection"
	button bpsel "Select Verts in BP"
	
	on expsel pressed do
	(macros.run "tools" "expandselection")
	
	on bpsel pressed do
	(
	mdf = $.modifiers[#bones_pro_3]

	modpanel.setcurrentobject $
	vertbitarray = getvertselection $ 
	vertarray = #()
	for i = 1 to vertbitarray.count do
	(
		if vertbitarray[i] == true then 
			(
			--print i
			append vertarray i
			)
		)
	--print vertarray[1]
	bpvertselect mdf "none"
	for i = 1 to vertarray.count do
	(
	bpsetvertsel mdf vertarray[i] true
	)
	modpanel.setcurrentobject $.modifiers[1]

	)-- end bpsel pressed
	
	) -- end rollout

on openfloater pressed do
(
global globalbpaidfloater
try (closerolloutfloater globalbpaidfloater) catch()
globalbpaidfloater = newrolloutfloater "BP Aid Floater" 200 120
addrollout bparollout globalbpaidfloater	
)
)--end utility