Re: [Maya-Python] PyMel: ParentConstraint

2011-04-20 Thread Paul Molodowitch
Hi Subbu - Unfortunately, the PyNode classes (such as pm.nt.ParentConstraint) do not contain all of the functionality of the corresponding commands (ie, pm.parentConstraint or cmds.parentConstraint). In particular, the initial creation of the underlying MAYA node must often be done with the

Re: [Maya-Python] PyMel: ParentConstraint

2011-04-20 Thread Paul Molodowitch
Oops... correction below: On Wed, Apr 20, 2011 at 7:28 AM, Paul Molodowitch elron...@gmail.comwrote: Hi Subbu - Unfortunately, the PyNode classes (such as pm.nt.ParentConstraint) do not contain all of the functionality of the corresponding commands (ie, pm.parentConstraint or

Re: [Maya-Python] PyMel: ParentConstraint

2011-04-20 Thread Judah Baron
Not directly related to this thread, but it is related to parentConstraints Has anyone noticed that parentConstraint offset rotations are not calculated correctly for nodes with parents that have negative scale? When the same thing is attempted, but using an orient constraint instead, the

Re: [Maya-Python] PyMel: ParentConstraint

2011-04-20 Thread John Patrick
Personally, I feel like I wouldn't be served well by having the PyNode class constructor handle node creation. After all, it's the command's job to create the node and hook it into the DG. I think, if anything, there maybe could be a class method that does a createNode() and returns a PyNode

Re: [Maya-Python] PyMel: ParentConstraint

2011-04-20 Thread Subbu Addanki
Hi All, Thanks a lot for replies. You saved my time so much for typing. pCon = PyNode(parentConstraint(cube1, cube2, cube3, mo=1, w=1)) w1 =pCon.getWeightAliasList()[0] As shown above, and as said by John Patrick, above command is done in one line and it serves my purpose. Now I can get drop

Re: [Maya-Python] PyMel: ParentConstraint

2011-04-20 Thread Subbu Addanki
Thanks Mr. Paul for the analysis and solutions on this topic ::==)) On Wed, Apr 20, 2011 at 8:32 PM, Subbu Addanki subbu@gmail.com wrote: Hi All, Thanks a lot for replies. You saved my time so much for typing. pCon = PyNode(parentConstraint(cube1, cube2, cube3, mo=1, w=1)) w1

Re: [Maya-Python] PyMel: ParentConstraint

2011-04-20 Thread John Patrick
Hey, don't let me rain on your parade!! It sounds like you have a valid point, given how the constructors are set up currently. And I'll agree, it does feel a little more satisfying to instantiate the classes directly :P I think the main downside is that it may be confusing for those new to

Re: [Maya-Python] PyMel: ParentConstraint

2011-04-20 Thread David Moulder
I suppose you could have a .createCmd() classmethod instead of the kw args and leave the current constructor as it is? I saw this on a PyCon video the other day. It's widely accepted that you should create multiple constructor methods rather then 1 complicated method and where possible stick to

[Maya-Python] parent ScriptJobs to a PyQT GUI in Maya

2011-04-20 Thread Shawn Patapoff
Hey, Has anyone found any other way to parent a scriptJob to a PyQt created GUI in maya without having to attach a maya created dummy object? This is what we're doing: dummyObj = cmds.helpLine(visible=False, width=100, parent='mainVerticalLayout') cmds.scriptJob( e=['SelectionChanged',

Re: [Maya-Python] parent ScriptJobs to a PyQT GUI in Maya

2011-04-20 Thread John Patrick
Could you override the closeEvent in whatever QWidget destroys the UI, and have it kill the scriptJob instead? On Wed, Apr 20, 2011 at 10:40 AM, Shawn Patapoff spatap...@bluecastlegames.com wrote: Hey, Has anyone found any other way to parent a scriptJob to a PyQt created GUI in maya

Re: [Maya-Python] parent ScriptJobs to a PyQT GUI in Maya

2011-04-20 Thread Shawn Patapoff
Hey John, That's a good idea, I think I'll look into that. Seems way cleaner. Thanks. On Wed, Apr 20, 2011 at 11:00 AM, John Patrick jspatr...@gmail.com wrote: Could you override the closeEvent in whatever QWidget destroys the UI, and have it kill the scriptJob instead? On Wed, Apr 20,

Re: [Maya-Python] parent ScriptJobs to a PyQT GUI in Maya

2011-04-20 Thread John Patrick
One thing I would worry about with that method is what happens in the case of an exception somewhere in the UI's __init__ after creating the scriptJob. This is overkill in this case (try/except would probably be just fine), but I'm a fan of contextManagers for this type of 'i really need to make

Re: [Maya-Python] parent ScriptJobs to a PyQT GUI in Maya

2011-04-20 Thread Shawn Patapoff
Hey John, Thanks a bunch for the recipe. Don't 100% understand it, but I'll look over it a bit more to get a better grasp. Pretty much just hacked it into what I was doing and all it working great. Thanks again, Shawn On Wed, Apr 20, 2011 at 11:54 AM, John Patrick jspatr...@gmail.com wrote:

[Maya-Python] Creating a polygon object.

2011-04-20 Thread Benjamin Golder
I would like to create a triangulated mesh-like object in Maya using PyMEL. Which command should I use to create a new polygon object from scratch? I have a list of coordinates tuples, with a (x,y,z) tuple for each point. I also have a list of index tuples for each triangular face I want to make,

[Maya-Python] MEL script to Python

2011-04-20 Thread Mark Naidenkov
Hi, I'm trying to translate MEL code to Python to get to it and I have couple of problems and I'm kind of new to maya programming/scripting and to these programming languages maybe someone could help me and tell where are the mistakes and how to solve it. I would be very grateful, Thanks for

[Maya-Python] Re: PyMel: ParentConstraint

2011-04-20 Thread Count Zer0
That being said, maybe there's a situation where using the PyNode constructor like a command would be convenient, I just haven't run into one :) Nah man, You definitely want to create all objects with PyMEL classes, that way you get an instance object and method completion in your Script