what would you suggest to use to check what type of component the current component is? let's say I have a mixed selection of faces, vertex, edges and polygon mesh and I want to split each type in different list...
import pymel as pm sel = pm.selected() for i in sel: if i.nodeType() == 'mesh': print '%s is a polygon mesh' %i if i.nodeType() == 'meshVertex': print '%s is a polygon vertex' %i if i.nodeType() == 'meshEdge': print '%s is a polygon edge' %i if i.nodeType() == 'meshFace': print '%s is a polygon face' %i I found an alternative method, but I would like to know if this is possible Thanks On Wed, Apr 8, 2009 at 10:33 AM, Paul Molodowitch <[email protected]>wrote: > > So, the reason is that 'nodeType' is intended to replicate > maya.cmds.nodeType() - ie, return the mel type name of a dgnode (ie, > something that you'd find in > http://download.autodesk.com/us/maya/2009help/Nodes/index.html) > > Since a component isn't a dgNode, nodeType for components (and > attributes) returns the dg node type of the dg node it's attached to. > > I can see why this might be confusing, so I added a note to the > docstring for nodeType. > > - Paul > > On Tue, Apr 7, 2009 at 11:52 AM, sberger <[email protected]> wrote: > > > > Hi, I am wondering why the nodeType() method of a vertex return mesh > > instead of meshVertex type? > > > > # run this code to repro > > sphere = pm.polySphere()[0] > > pm.select('%s.vtx[0:10]' %sphere, r=True) > > sel = pm.ls(sl=True, fl=True) > > for i in sel: > > print 'nodeType:', i.nodeType() > > print type(i) > > > > Thanks > > > > > > > > > -- They say, "Evil prevails when good men fail to act." What they ought to say is, "Evil prevails." Nicolas Cage as Yuri Orlov in Lord of War. --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
