A blog about technical art, particularly Maya, Python, and Unity. With lots of obscurantist references

We've Moved

The blog has been retired - it's up for legacy reasons, but these days I'm blogging atblog.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 . I'm experimenting with crossposting from the live site, but if you want to keep up to date use blog.theodox.com or just theodox.com

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.

About Me

I fell in love with computer animation in the Dark Ages, in more ways than one: I dropped out of a Ph.D. program in ancient history to start rendering 3D scenes on the Brown University mainframe back in the wee early 1990's. I went pro in 1993, doing animations for a variety of commercial and television projects.

My first game job was building mechs and environments for FASA's MechCommander in 1995.