Wednesday, October 12, 2011

Maya toggle component



Not a special script.

If you feel the default component hot key(F8~F12) of Maya is too far away :P , then you can use this little script to toggle component modes by your own keyboard shortcut.

Just copy/paste this script to your "Hotkey Editor", and set your own preferred hot key.

Maybe not perfect, but it works fine and can speed up your modeling process.

Hope this helpful. Cheers! :)






一個小script,也許不是很完美,但如果你希望能夠快速切換Maya的component modes以利你的建模作業的話,那麼你可以利用這個小script。只要copy/paste到你的"Hotkey Editor"裏頭設定成你自己想要的hotkey就可以用了,希望這有所幫助。 :)





Script:

int $componentQuery = `selectMode -q -component`;
int $vertexQuery = `selectType -q -smp`;
int $edgeQuery = `selectType -q -sme`;
int $faceQuery = `selectType -q -smf`;

if($componentQuery == 0){
SelectVertexMask;
setSelectMode components Components; selectType -smp 1 -sme 0 -smf 0 -pv 1 -pe 0 -pf 0;
}
if($vertexQuery == 1){
SelectEdgeMask;
setSelectMode components Components; selectType -smp 0 -sme 1 -smf 0 -pv 0 -pe 1 -pf 0;
}
if($edgeQuery == 1){
SelectFacetMask;
setSelectMode components Components; selectType -smp 0 -sme 0 -smf 1 -pv 0 -pe 0 -pf 1;
}
if($faceQuery == 1){
setSelectMode components Components; selectType -smp 0 -sme 0 -smf 0 -pv 0 -pe 0 -pf 0;
setSelectMode objects Objects;
}

No comments:

Post a Comment