ScriptSpot

Forum topic · Scripts Wanted

Automatic UV Packing

By grusgrus · 2008-10-29

Description

I am currently in the process of building a fairly large virtual environment, which involves 500+ buildings that have to be texture mapped and rendered.

This involves adding UV unwraps to all 500 buildings, and packing the UV's properly. I am using the Pack UV's tool in MAX (it's not prefect, but quicker than doing it by hand, and time is a factor). I still have to do each one manually though, which takes a lot of time.

What I really would like to find, is a script that automatically runs the Pack UV's tool for all selected objects, with a settings preset.

Any suggestions as to how i might find/create such a script would be much appreciated :)

-G

Comments (4)

Marco Brunetta · 2008-11-07

No prob. Glad I could help

grusgrus · 2008-11-07

That worked like a charm (and saved me a few days of the most awfully boring work imaginable).

Thanks again.

-G

grusgrus · 2008-11-07

Thank you very much :)

I'll give this one a try, and see what happens.

-G

Marco Brunetta · 2008-10-31

perhaps something along the lines of
FOR o in selection DO
(
local newUVW = Unwrap_UVW()
addmodifier o newUVW
newUVW.pack 0 5.0 true false false
)

the part after newUVW.pack has all the settings of the pack dialog. Look for pack() in the maxscript reference for more info.

BTW, I did not test this...so..good luck =D