I'm trying to write a script that will take any random Editable Poly object, apply an Unwrap_UVW modifier, then Quick Planar Map every polygon in the object individually, normalize all these UV-islands relative to each other, and pack them inside a 1-unit UV space without overlap. I'm very close to getting what I want, but Max is throwing an exception in the following code:
print "*************************";
mybox = Box length:10 width:5 height:2;
ConvertTo mybox Editable_Poly;
polyCount = polyop.getNumFaces mybox;
addModifier mybox (Unwrap_UVW());
mybox.Unwrap_UVW.unwrap2.setTVSubObjectMode 3;
for i = 1 to polyCount do
(
mybox.Unwrap_UVW.unwrap.selectPolygons #{i};
mybox.Unwrap_UVW.unwrap2.unfoldMap 0;
)
mybox.Unwrap_UVW.unwrap.selectPolygons #{1..polyCount};
mybox.Unwrap_UVW.unwrap2.pack 1 0.02 true true true;
Can anyone help me out here? This script should run fine, but it's giving me a huge headache. Try running this in Max 2012 and tell me why it doesn't work. Or is Max just buggy with this?
br0t · 2011-05-18