Oops... correction below:
On Wed, Apr 20, 2011 at 7:28 AM, Paul Molodowitch <elro...@gmail.com> wrote:
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 command form. In fact, the only way it is currently possible to trigger the creation of the underlying maya node AND the pynode with the pynode constructor is when the PyNode constructor is fed no non-keyword args (such as when you do nt.ParentConstraint(mo=1, w=1) ). If you need to create the underlying node in manner in which you feed in other node args, you'll have to fall back on the command:import pymel.core as pmcube1 = pm.polyCube()[0]cube2 = pm.polyCube()[0]pCon = pm.parentConstraint(cube1, cube2, mo=1, w=1)
In general, my habit is often to use the commands to create, and the PyNode class constructors to create PyNodes for already-existing maya nodes. I agree, though, that it would be nice to expand support for node creation in
PyNode class constructors to be able to handle these situations as well.
Oops... correction below:
On Wed, Apr 20, 2011 at 7:28 AM, Paul Molodowitch <elro...@gmail.com> wrote:
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 command form. In fact, the only way it is currently possible to trigger the creation of the underlying maya node AND the pynode with the pynode constructor is when the PyNode constructor is fed no non-keyword args (such as when you do nt.ParentConstraint(mo=1, w=1) ). If you need to create the underlying node in manner in which you feed in other node args, you'll have to fall back on the command:import pymel.core as pmcube1 = pm.polyCube()[0]cube2 = pm.polyCube()[0]pCon = pm.parentConstraint(cube1, cube2, mo=1, w=1)
In general, my habit is often to use the commands to create, and the PyNode class constructors to create PyNodes for already-existing maya nodes. I agree, though, that it would be nice to expand support for node creation in
PyNode class constructors to be able to handle these situations as well.
- Paul
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 command form. In fact, the only way it is currently possible to trigger the creation of the underlying maya node AND the pynode with the pynode constructor is when the PyNode constructor is fed no non-keyword args (such as when you do nt.ParentConstraint(mo=1, w=1) ). If you need to create the underlying node in manner in which you feed in other node args, you'll have to fall back on the command:import pymel.core as pmcube1 = pm.polyCube()[0]cube2 = pm.polyCube()[0]pCon = pm.parentConstraint(cube1, cube2, mo=1, w=1)
In general, my habit is often to use the commands to create, and the PyNode class constructors to create PyNodes for already-existing maya nodes. I agree, though, that it would be nice to expand support for node creation in
- Paul