We've Moved

The blog has been retired - it's up for legacy reasons, but these days I'm blogging at blog.theodox.com. All of the content from this site has been replicated there, and that's where all of the new content will be posted. The new feed is here

Thursday, February 5, 2015

What The...?

Like many Maya heads I have long wrestled with the problem of filtering lists to get what I'm interested in.  You're probably familiar with the use of  the type flag in cmds.ls() to filter on types: for example this will give you only the transforms in your current selection:

cmds.ls(sl=True, type = 'transform')

This works for any node type (the list is quite long: it's basically the whole maya node class hierarchy) and is a handy way to 

However I just noticed today that this works a little for component selections as well.  For some reason Maya 2014+ seems to treat faces, edges and vertices as if they were nodes of a "float3" type (uv's are "float2"s) .  This means you can get the components from a mixed selection with:

cmds.ls(sl=True, type = 'float3')  

Not the most earth-shattering discovery of the 21st century, but handy nonetheless.