Auto Joint Orientations in Maya

I have this pet peeve:  Whenever I create joint hierarchies in Maya, it will automatically setup the joint orientation value for you (based on option set in the ‘Joint Tool’ tool settings).  That, is handy.  However, the last joint in the chain isn’t auto-oriented:   A joint’s auto-orientation is based on the vector between it, and its child.  So obviously, the last joint in the chain has no child, so it can’t use this system.  The result is, the last joint is always oriented to the worldspace global axis.  Which is almost exactly never what I want.

The workaround is easy, just make a little script to process all the joints in a selected hierarchy.  But it sure would be nice if they had an option to do this automatically in the UI….

"""
Eric Pavey - 2008-12-19
For the selected hierarchies, zero the joint orient values
on all leaf joints
"""
# Python code
import maya.cmds as mc

kids = mc.listRelatives(mc.ls(selection=True), children=True, type="joint", allDescendents=True)
for k in kids:
    if mc.listRelatives(k, children=True, type="joint") is None:
        for attr in [".jointOrientX", ".jointOrientY", ".jointOrientZ"]:
            mc.setAttr(k+attr, 0)
        print "Zeroed '" + k + ".jointOrient'"

WordPress, day 2

I’ve learned enough to do some damage to the header.php template, and get the title bar of the blog to display my ‘blog description’. This is just more of a novelty at the moment, but I hope that some of it sticks to my brain 😛 Also fooling with some of the link stuff.  Also switched to the ‘Atahualpa‘ theme…. let’s mix it up a bit…

Finally, starting on this WordPress thingy…

My first official post on this blog I guess. After years of thinking about it, I’ve finally got my own domain. I hope to get a better spread of the projects I enjoy posted up here, and blog a bit about what I’m up to, both professionally and personally. I’ve got a lot to learn though, and currently reading “WordPress for Dummies” (2nd edition). I’ve got to get rid of this default theme…..

Hello world!

Please wait….  updates coming….