Home Technical Talk

MS to resize an object's texture

Hi everybody!

I'm new here and totaly new to maxscripting.

I've looked around and it seems possible but no clue how to get
started. I'm looking for a script that will allow me to resize the bitmap
texture of a selected object.

For example a cube in scene has an 512x512 diff map assigned to it
and I would like to bring it down to 128 x 128

If anyone can steer to a right direction it would be much
appreciated.

Thank you!

RK

Replies

  • monster
    Offline / Send Message
    monster polycounter
    MaxScript is not the right tool for this. It's too slow handling image files.

    Maybe you can try using render to texture to render a smaller image size (with MaxScript).
  • LoTekK
    Offline / Send Message
    LoTekK polycounter lvl 17
    It's too slow handling image files
    It kinda depends, though. If you don't need bilinear filtering on the resize (ie, basically nearest neighbour resize), you can just copy to a new bitmap:
    oldBitmap = openBitmap oldbitmapPath
    newBitmap = bitmap 128 128  --the new bitmap size
    copy oldbitmap newbitmap
    

    This basically does a straight resize with nearest neighbour. It's fast, but whether nearest neighbour filtering is sufficient for your needs is up to you.
  • Rokhound
    Thank you! Will post back feedback as soon as I try it out.
Sign In or Register to comment.