Message 1 of 6
Check object type?

Not applicable
07-06-2011
07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
my problem is really simple.. i need to know witch type is my selected object.
Actually i do something like:
how can I check if what I select is a Locator or a Polygon?
(to simplify the problem i can check just one of them and with an IF-ELSE statement i can continue by myself)
my problem is really simple.. i need to know witch type is my selected object.
Actually i do something like:
selList = OM.MSelectionList()
OM.MGlobal.getActiveSelectionList( selList )
selListIter = OM.MItSelectionList( selList )
while not selListIter.isDone():
dagpath = OM.MDagPath()
component = OM.MObject()
dagnode = OM.MFnDagNode()
selListIter.getDagPath( dagpath, component )
dagnode.setObject( dagpath )
# check type of object selected
#
# if POLYGON: do something
#
# if LOCATOR: do something
#
#
selListIter.next()
how can I check if what I select is a Locator or a Polygon?
(to simplify the problem i can check just one of them and with an IF-ELSE statement i can continue by myself)