Using maya.cmds you'd probably want to execute the MEL commands that do the same actions Andres detailed. I'm not sure how to do that but if you turn on "Echo All Commands" in the Script Editor and do some digging in the MEL scripts that ship with Maya, you might be able to figure it out.
Using PyMel, or the C++ or Python API, I think you could do it faster than the script you linked by using the isRightHandedTangent function of PyMel's Mesh or the API's MFnMesh class. (You can pass UV ids to that function.) You'd still have to iterate through all UV IDs but you let Maya do the vector math for you. You would then probably select the left-handed UVs for the user to flip. Flipping them in script would be more complex because you'd have to account for cases where a UV shell folds on itself. On Tuesday, 2 May 2017 09:00:46 UTC+10, likage wrote: > > Hi Andres, thanks for getting back. > > The settings you have given works like a charm! Was not aware of such a > setting as I only knows of selecting the faces and flipping them manually. > Though I have yet to check all the UVs in general if they are working > correctly/ have changed anything in its initial setup. > > I have managed to found a code from cgsociety > <http://forums.cgsociety.org/showthread.php?t=933937>, though it is using > pymel, its execution speed seems to be wayyyy longer as compared to the > solution derived by Andres as it seems to be iterating every single uv it > can find... > > Even so, I am still curious if there is a pythonic way (using maya.cmds) > to do it? > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0856cc18-fdb2-4a30-8684-2749489a1629%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
