I’m playing around with selection masks and came to the conclusion that there is something fishy going on with this command.
# Part 1 - Run this, select some components, then run part 2
import pymel.core as pm
pm.mel.changeSelectMode("-component")
pm.selectType(edge=True, polymeshEdge=True)
pm.selectType(allComponents=False, objectComponent=True, edge=True, polymeshEdge=True)
# Part 2 - notice the below comment. Try and select edges now - it will jump back to vertex selection
import pymel.core as pm
pm.mel.changeSelectMode("-component")
# pm.selectType(edge=True, polymeshEdge=True)
pm.selectType(allComponents=False, objectComponent=True, edge=True, polymeshEdge=True)
So, we need the setup in Part 1 where we call exec selectType twice - else the mask seems to revert back to the “old” one.
Also, what exactly does the objectComponent -flag do? Changing that boolean does nothing. True has the same effect as False - or am I missing something?
Did a g/re/p on the native script files and found this in texturePanelMenus.mel
$cmd = ("changeSelectMode -component; setComponentPickMask \"Facet\" true; " +
"selectType -ocm -alc false; " +
"selectType -ocm -facet true; " +
"selectType -sf false -se false -suv false -cv false; ");
setComponentPickMask is a MEL script consisting of… even more selectType -commands -_- Not cool.
Maybe someone with Maya API skills knows why this command is so broken!?!