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

2018-04-04 Thread Justin Israel
Did you do any profiling of your code to narrow down the hot spots? You can also try maya.cmds as an alternative if you determine that any of the PyMel calls are slow. On Wed, Apr 4, 2018, 4:44 PM Darby Edelen wrote: > Hello, > > I'm new to the list and relatively new to Maya. > > I've been mis

[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

[Maya-Python] Matrix inverse of several transformations ?

2018-04-04 Thread justin hidair
I'm relatively new in the matrix game , I'm trying to apply some rotation , position and scale in one matrix on a object, and it did work , I just had to multiply the matrices together to obtain one transformation matrix, it does its job but the problem is that I need at some point to revert the

[Maya-Python] Re: Matrix inverse of several transformations ?

2018-04-04 Thread justin hidair
# matrix to position to center pos_mat = om.MMatrix( [ (1,0,0,0), (0,1,0,0), (0,0,1,0), (-o.x,-o.y,-o.z,1) ] ) # matrix to flatten on y scale_mat = om.MMatrix( [ (1,0,0,0), (0,0,0,0),

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: Matrix inverse of several transformations ?

2018-04-04 Thread justin hidair
nvm fixed it, this is confusing tho but when you are done with your transformations and you find yourself at the origin you just need to add the previous position to your transformed points , the code speaks for itself, basically if the plane stay the same, it means it works , and it worked ...

Re: [Maya-Python] Useful cycleCheck script

2018-04-04 Thread Michael Boon
If I create a cube and a cone, and parent constrain the cube to the cone, then do cmds.cycleCheck('pCube1.r', dag=True, list=True) I get # Result: [u'pCube1.rotateY', u'pCube1_parentConstraint1.constraintRotateY', u'pCube1.rotateX', u'pCube1_parentConstraint1.constraintRotateX', u'pCube1.transl

[Maya-Python] Re: Maya and NumPy 1.14.2

2018-04-04 Thread justin hidair
Yow , Bro I gotchu https://drive.google.com/drive/folders/0BwsYd1k8t0lEMjBCa2N1Z25KZXc -- 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 p

[Maya-Python] Re: Matrix inverse of several transformations ?

2018-04-04 Thread Michael Boon
Glad you got it. One thing I noticed from your first post there, is "matrix to flatten on Y." You can't actually inverse a matrix that flattens things to a plane. Mathematically, it requires dividing by 0 as your determinate will be 0. Physically think about the fact that an infinite number of

RE: [Maya-Python] Re: Matrix inverse of several transformations ?

2018-04-04 Thread justin hidair
Yes I noticed that , flattening is not reversible , fortunately in my case it doesn’t need to be so I just reverse the translation and the rotation. If I were to do it tho, I would just register the points prior flattening Sent from Mail for Windows 10 From: Michael Boon Sent: Thursday, April 5

[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

[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

Re: [Maya-Python] Useful cycleCheck script

2018-04-04 Thread Marcus Ottosson
That dag argument looks suspicious, how come you include it? dag (dag) | Also look for cycles due to relationships in the DAG. For each DAG node, the parenting connection on its children is also considered when searching for cycles. - Reference

Re: [Maya-Python] Useful cycleCheck script

2018-04-04 Thread Michael and Amanda
Ah thanks, that's good to know. I was misinterpreting dag. I put it there because the node I was struggling with had no cycles of its own, but its ancestors had some (dozens, if you believe cycleCheck). Without dag=True, I got nothing, and with it, I got a page of text. Still, if this node doesn't

[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