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
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
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
(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
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
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
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