UV rotation without selection

25 views
Skip to first unread message

psich...@gmail.com

unread,
Jan 10, 2020, 3:35:57 PM1/10/20
to Python Programming for Autodesk Maya
Hi everyone,

I currently working on a little script which has just one purpose, to make a 90 °rotation of an object's uvs from a pivot at x0.5 y 0.5.
So, on the paper it's something easy, but in the practice I'm a bit confused.

I would like to perform this operation on a large number of asset and so far all I can find the maya.cmds are function that requires to select the UVs before the rotation.
If I pick only one object it works nicely but as soon as I select a dozen of meshes it takes forever :/

Right now, I use something like that : 

for toto in selection:
    mapCount =cmds.polyEvaluate("toto", uvcoord=True)
    cmds.polyMoveUV( 'toto .map[0:{0}]'.format(str(mapCount-1)), rotationAngle = 90,pvt = [0.5,0.5] )

But It's actually selecting all the uvs under the hood :/

Does anyone have a solution for that ? 

Cheers

Psichari 
Reply all
Reply to author
Forward
0 new messages