[Closed] unwrap uvw not applying to multiple selection
Hi all,
Hopefully someone can help with this, i’m a bit of a novice at all this maxscript business!
I’ve written a script which will apply Unwrap UVW modifier to an object, then change the channel and reset the UV’s. It then goes through the objects modifier stack and deletes a specified modifier if it finds it (Bend modifier in the example code below). This is all working fine, but it won’t work when i have more than one object selected, am i missing something here to make it work on multiple object??
Please tell me this is an easy fix someone! Any help with the below code is greatly appreciated.
(
for obj in selection do
(
addmodifier obj (Unwrap_UVW()) ui:on
obj.modifiers[#unwrap_uvw].unwrap.setMapChannel 2
obj.modifiers[#unwrap_uvw].unwrap.reset()
)
if validModifier selection Unwrap_UVW then
(
for obj in selection do
for index = obj.modifiers.count to 1 by -1 do
if ((classOf obj.modifiers[index]) == Bend) do
deleteModifier obj index
)
)