	try(destroydialog Hoha_MaterialID_rollout)catch()
	get_id_num = 5

rollout Hoha_MaterialID_rollout "HoHa Multi ID V1.1"
(
		group "Usage" (
		label use1 "This script is to add material modifiers to  " align:#left
		label use2 "selection, and assign different IDs.  "  align:#left
		label use3 "Select objects by order, enter number "  align:#left
		label use4 "of IDs, and GO."  align:#left
		label use7 "REMEMBER!!" 
		label use8 "It ADDS material Modifier on your objects!" 
		label use6 "" 
		label use5 "Use at your own risk !!!"  align:#left
	)
	label lb1 "" 
spinner id_num_spn "Number of IDs: " range:[0,255,get_id_num] align:#center type:#integer scale:1
button materialID_them "Set material ID!" width:200 height:50
button Random_materialID_them "Set material ID by Random!" width:200 height:50
	
		group "About" (
		label lbl1 "HoHa" align:#center
		label lbl2 "www.hohadesign.com/" 
		label lbl3 "superhoha@gmail.com" 
		label lbl4 "" 
	)
	
on materialID_them pressed do
(
get_id_num = id_num_spn.value
j=1
for i in selection do(
	materialID_mod= Materialmodifier ()
		addmodifier i materialID_mod
		i.modifiers[#Material].materialID = j
		j=j+1
		if j == get_id_num+1 then j = 1
	)
)

on Random_materialID_them pressed do
(
get_id_num = id_num_spn.value
for i in selection do(
	materialID_mod= Materialmodifier ()
		addmodifier i materialID_mod
		j= (random 1 get_id_num)
		i.modifiers[#Material].materialID = j
	)
	
)--end on
)--end rollout
createDialog Hoha_MaterialID_rollout 220 430