[Maya][Mel][Python] Set UV Lattice Point Positions


Hi all,

I’m trying to edit some UVs via the “Lattice” tool in code. When I enable the Lattice tool manually (UV Editor: Tools > Lattice) with some UVs selected the Script Editor spits out this code:

tvLatticeToolCallback OptionBoxWindow|formLayout157|tabLayout4|formLayout159|tabLayout5|columnLayout5 1;
setAttr "texLattice1.latticeWidth" 2;
setAttr "texLattice1.latticeHeight" 2;
setAttr "texLattice1.boundingBoxSup" -type double2 0 0.875 ;
setAttr "texLattice1.boundingBoxInf" -type double2 0.15 0.625 ;
setAttr "texLattice1.latticePoint[9]" -type double2 0.15 0.5 ;
setAttr "texLattice1.latticePoint[8]" -type double2 0.15 -0.5 ;
setAttr "texLattice1.latticePoint[1]" -type double2 -0.15 0.5 ;
setAttr "texLattice1.latticePoint[0]" -type double2 -0.25 -0.5 ;

When I copy-paste this same code and/or try to edit any of the ‘latticePoint’ values, nothing happens. The only thing that has a visible difference is using the “tvLatticeToolCallback” command which will go into lattice mode. But I can’t figure out how to actually edit the values.

I’m essentially trying to move the 4 points of the lattice to fill the 0-1 space.
[EDIT] I was able to solve my issue with 1 simple command (cmds.polyNormalizeUV(preserveAspectRatio=False)) but I’ll leave this post in case anyone needs has insight about editing UV lattices in code. I wasn’t able to find any other resources about it online.

If anyone has any insight on the issue, I’d very much appreciate it.