Home Technical Talk

Max script, how to see uv channels

codyaq2
greentooth
Offline / Send Message
codyaq2 greentooth
Hey

I have a few hundred objects in my scene, and i want to find out what the highest UV Channel number there is in a selection of objects. I know you can look in channel info, but when you have a lot of objects, it gets messy to find it.

Cheers

Cody

Replies

  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    function HighestUVChannel = (
    	ch = 0
    	for o in $* where o.modifiers[#Unwrap_UVW] != undefined do (
    		if o.modifiers[#Unwrap_UVW].getMapChannel() > ch then (
    			ch = o.modifiers[#Unwrap_UVW].getMapChannel()
    		)
    	)
    	ch
    )
    

    HighestUVChannel() will then return the greatest UV Channel number in the scene.
  • codyaq2
    Options
    Offline / Send Message
    codyaq2 greentooth
    Thanks, but it doesn't seem to return a value, only returns HighestUVChannel().
  • ahosking
    Options
    Offline / Send Message
    codyaq2 wrote: »
    Thanks, but it doesn't seem to return a value, only returns HighestUVChannel().
    HighestUVChannel()
    
    Execute that after you execute the example code to get the number you are looking for.
  • ahosking
    Options
    Offline / Send Message
    codyaq2 wrote: »
    Thanks, but it doesn't seem to return a value, only returns HighestUVChannel().

    Execute
    HighestUVChannel()
    
    to get your result.
    Alternatively, run:
    function HighestUVChannel = (
    	ch = 0
    	obj
    	for o in $* where o.modifiers[#Unwrap_UVW] != undefined do (
    		if o.modifiers[#Unwrap_UVW].getMapChannel() > ch then (
    			ch = o.modifiers[#Unwrap_UVW].getMapChannel()
    			obj = o.name
    		)
    	)
    	ch
    	format "% has % channels.\n" obj ch
    )
    HighestUVChannel()
    
Sign In or Register to comment.