[Maya-Python] Re: Looking for Feedback on This Face Selection Script

2018-04-05 Thread Michael Boon
OK I ran out of time but I do have something. The interface is very rough - it only uses the first selected component, and I don't have it selecting the result at the end. However, it does process 90,000 faces in under 1 second on my PC. So that's something :) import math import maya.api.OpenMa

[Maya-Python] Re: Looking for Feedback on This Face Selection Script

2018-04-05 Thread Michael Boon
100,000 faces would take minutes. Growing a list one element at a time in Python gets very slow as your list gets big. I start with a flattened list of faces, then I'm just looping on my list until I get to the end. Inside the loop looks a bit like this: normal = face.getNormal() connected = fac

[Maya-Python] Re: Looking for Feedback on This Face Selection Script

2018-04-04 Thread Darby Edelen
There are definitely some intricacies of pymel that elude me. I don't know, for example, how to get a flattened list of connected faces without using ls. Or perhaps I don't need a flattened list? I assume that I need to getNormal on each face and compare against its connected faces in order to d

[Maya-Python] Re: Looking for Feedback on This Face Selection Script

2018-04-04 Thread Michael Boon
(I got a little cocky there. My script doesn't do a check for hard edges!) On Thursday, 5 April 2018 15:51:55 UTC+10, Michael Boon wrote: > > It's a bit of a myth, or at least an over-simplification, to say that > PyMel is slower and maya.cmds is faster. MEL and maya.cmds tend to be slow > becau

[Maya-Python] Re: Looking for Feedback on This Face Selection Script

2018-04-04 Thread Michael Boon
It's a bit of a myth, or at least an over-simplification, to say that PyMel is slower and maya.cmds is faster. MEL and maya.cmds tend to be slow because they do string processing for almost everything (and for that reason they're also error-prone once you get into scenes with instances). PyMel

Re: [Maya-Python] Re: Looking for Feedback on This Face Selection Script

2018-04-04 Thread Tim Fowler
There's also a couple ways of doing this kind of thing in Maya... In the Modeling Toolkit panel you can set the "Selection Constraint" drop-down to "Angle" and then play with the value (which I think is the angle in degrees bewteen the face normals). That will transform every selection you make t

[Maya-Python] Re: Looking for Feedback on This Face Selection Script

2018-04-04 Thread justin hidair
You don't need to use one workflow you can use maya.cmds it has polyListComponentConversion , and the maya python api 2.0 ( maya.api.OpenMaya , which is pythonic AF ) , yeah I suggest you get rid of pymel you don't need it > > -- You received this message because you are subscribed to the Go