I'm working on a script that removes unneaded map channels from selected meshes. Right now it's coded to remove UV channels 2-4, vertex alpha & illumination - later I'll see if I can have a UI that asks what channels you'd like to keep and have it detect how many channels each object has.
Now to the problem, I don't really know what I'm doing here - it runs fine on a single object but once multiple objects are selected it crashes. Shouldn't the do loop look at each mesh in the array individually? I know if I select a bunch of meshes and open the map channel info viewer it just groups them all together - so I wonder if the script has to cycle through each selected mesh unselecting the rest. (most of the script is stolen from Mark's max script for noobs thread)
(
(
local meshes = $
if meshes != undefined then (
for i in meshes do (
channelInfo.ClearChannel $ 4
channelInfo.ClearChannel $ 3
channelInfo.ClearChannel $ 2
channelInfo.ClearChannel $ -1
channelInfo.ClearChannel $ -2
maxOps.CollapseNode i off
)
)
else (
messagebox "Nothing selected." title: "Selection Failure"
)
)
)
Replies
Oh wow, seems like the script doesn't care if there is only a UV 2 - so I won't have to worry about making it check if the extra channels exist or not.
this leads me to another question - how the heck to meshes seem to collect extra UV channels like flies on poop? Lots of this is outsourced stuff that has a bunch of UV channels, it adds up to about 2-4mb per max file - not a huge amount but it adds up when you have thousands of assets.
Outsourced art... the shit you have do to get it running is amazing...
They probably just click and drag the Map Channel slider and crank it up to some higher number to create a new UV channel and don't realize that if you jump from 1-9 it creates map channels for 2-8 also. In short, they're probably just retarded and not using 1-2 channels properly... FUN!