Script doing different things depending on current component selection mode?


#1

How would I go about it?
Basically if selVertexMask is active do command x if selEdgeMask do y etc.


#2
import pymel.core as pm
if pm.selectType(query=True, polymeshFace=True) == True:
    # do command x
elif pm.selectType(query=True, polymeshVertex=True):
    # do command y

# == True not necessary as the pm.selectType command evaluates to True, but it improves readability

http://download.autodesk.com/global/docs/maya2012/ja_jp/PyMel/generated/functions/pymel.core.general/pymel.core.general.selectType.html?highlight=selecttype#pymel.core.general.selectType


#3

Perfect

Cheers