The first script you linked is NOT using isRightHandedTangent. Instead it 
creates vectors and does a cross product in Python, which would slow it 
down for sure.

The second script is very involved! It uses the API for some stuff but it 
is also iterating through all faces by converting each of them to a string 
and then a PyMel object. It then creates vectors and does a cross product 
in Python, just like the first script, so I expect it is even slower.

If *maya.cmds.polyMultiLayoutUV* does what you want, I think you should 
stick with it. I don't think you'll find anything that can match its speed, 
and as a bonus, you have less code to maintain.


On Wednesday, 3 May 2017 02:57:02 UTC+10, likage wrote:
>
> 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.
>>
>
> Hi Michael, yes I am able to use the solution given by Andres and convert 
> them using *maya.cmds.polyMultiLayoutUV.*
> By the way, how are you able to tell that the script I have linked is 
> using the *isRightHandedTangent* function (I have hardly used PyMel, 
> mostly I am using maya.cmds)?
>
> I have also managed to find another script that uses both PyMel and Maya 
> Api altogether. Tried running it (though there are some errors), I think it 
> run similarly to the script I have linked previously but it is still slow, 
> nowhere fast as the solution provided by Andres.
>
> < Script02 <https://gist.github.com/SEVEZ/642535b8baeaedb02a56> - Uses 
> PyMel + Maya Api >
>
> To my knowledge, I had thought that using of maya api will makes the 
> process faster? Wondering if the cause of slowness could be due to PyMel - 
> read that PyMel is more in ease of use over execution speed
>
>
>
>
>
>
>

-- 
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/c2a1b2c7-5e60-4317-a3e3-e19abe491023%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to