You're right. I just copied the example above. Not much of a difference using command or class for instanciation:
from pymel.core.nodetypes import PolyCube cube1 = PolyCube() both return PyNodes. And importing into root namespace is very much a preference thing. I know everybody imports differently. I oscillate between lazy importing into root namespace and importing in just the modules/commands I need. Just glad to see another PyMEL user, JP. On Apr 21, 9:16 am, John Patrick <[email protected]> wrote: > We're not talking about using pymel or not - when I say command, I mean a > pymel command (which returns a PyNode instance) vs. maya node creation via > direct instantiation of a pymel class. You're using the command in your > example, for instance :) > > As an aside, I still don't like to import everything from pymel into the > root namespace. It's too easy for me to accidentally overwrite things (even > though it's perfectly safe if you're more careful). > > > > > > > > > > On Wed, Apr 20, 2011 at 10:44 PM, Count Zer0 <[email protected]> wrote: > > > 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 Editor > > or IDE. > > > No need to worry about importing in Maya2011/2012. This works straight > > up: > > > cube1 = polyCube()[0] > > cube2 = polyCube()[0] > > pCon = parentConstraint(cube1, cube2, mo=1, w=1) > > > Then type 'pCon.' in your Editor/IDE and watch the code-completion > > save your day. Even if you're using older Maya you can go ahead and > > import with asterisk and not have to worry about namespaces, like > > this: > > > from pymel.core import * > > > If you are not embracing PyMEL at this point, you are falling way > > behind the curve. Those who are, are racing ahead writing tons of > > readable, powerful OOP maya code, super-duper fast. Just sayin. > > > -- > >http://groups.google.com/group/python_inside_maya > > -- > John Patrick > 404-242-2675 > [email protected]http://www.canyourigit.com -- http://groups.google.com/group/python_inside_maya
