-- Copy UV and Bitmap Channel -- Christopher Grant, chris@christophergrant.com | www.christophergrant.com -- -- Based on request from Tim on ScriptSpot -- http://www.scriptspot.com/forums/3ds-max/scripts-wanted/uvw-map-channel-script-needed -- -- Description -- Useful for instances where you're baking lighting into UV3 and need to export to an engine that only works with UV1. -- This script copies the UV data from channel 3 to channel 1 and updates all bitmaps that referenced UV3 to UV1 ------------------------------------------------------------------------------------------------------------------------------------------------- -- Variables srcUV = 3 destUV = 1 ------------------------------------------------------------------------------------------------------------------------------------------------- -- Copy UV data on geometry -- This bit of code copies the UV map data from source (ie 3) to target (ie 1). It then clears the UV data from channel 3. This is the same functionality found in Tools / Channel Info. for o in geometry do try ( channelinfo.copychannel o 3 srcUV channelinfo.pastechannel o 3 destUV channelinfo.clearchannel o srcUV ) catch() -- Set bitmap UV channel -- This bit of code grabs all the bitmaps in the scene and if their UV channel is set to 3 then it'll set them to 1. Thus this protects from cases where UV2 was being used since we dont' want that set to 1 maps = getClassInstances bitmaptexture for m in maps where m.coords.mapChannel == srcUV do ( m.coords.mapChannel = destUV )