Notifications
Clear all

[Closed] UV script, porting from max2008 to max2009

Hi everyone,

I wrote this little script which selects my uv polygons my material ID and then shifts them 1 unit along the U. It work fine in max2008 but when I ran it in max2009, nothing happened. Have you got any idea why it won’t work there?

rollout shuv "ShiftUVs" width:160 height:80
 (
 	button btn_shift "Shift UVs" pos:[8,8] width:136 height:24
 	button btn_pack "Pack UVs" pos:[8,34] width:136 height:24
 	spinner spn_MatIDs "" pos:[72,60] width:72 height:16 scale:1
 	
 	on btn_shift pressed do
 	(
 		if selection.count != 0 then
 		(
 			addmodifier $ (unwrap_uvw())
 			for i = 1 to spn_MatIDs.value do
 			(
 				$.modifiers[1].unwrap2.selectByMatID i
 				$.modifiers[1].unwrap2.moveSelected [(i-1),0,0]
 			)
 		)
 		else messagebox "Select an object, punk!" title:"ERROR"
 	)
 	on btn_pack pressed do
 	(
 		if selection.count != 0 then
 		(
 			addmodifier $ (unwrap_uvw())
 			for i = 1 to spn_MatIDs.value do
 			(
 				$.modifiers[1].unwrap2.selectByMatID i
 				$.modifiers[1].unwrap2.moveSelected [-(i-1),0,0]
 			)
 		)
 		else messagebox "Select an object, punk!" title:"ERROR"
 	)
 )

Thank you

1 Reply

Hmm, I just included this line and it worked
$.modifiers[1].unwrap2.setTVSubObjectMode 3