Archive for February, 2009

Centering joints in edge loops

When I’m rigging, I will often create an initial ‘rig-skeleton’ that fits inside the mesh to be deformed. To speed things along, I first just rough in the joint positions by snapping them to verts.   But later I like to get them centered into a selection of verts, and usually that selection is some form of edge loop.

I wrote some mel that does this:

  • You pick a joint, and an edge on a mesh
  • The code detects the joint, and the edge
  • Based on the edge, find the edge loop
  • Convert the edge loop into a selection of verts
  • Find the average position of all the verts
  • Move the joint pivots to this new position
  • Reselect the joint, and the new vert selection.

You can find the mel code over on my Mel Wiki.

Updated ‘Processing Sketches’ page

One of the main reasons I wanted to make my own site was to get my Processing sketches up online.  Success!  I’m just starting to upload them, and they are now accessable via the ‘Processing Sketches‘ menu drop-down.  Over time I’ll be updating these sub-pages with the stuff I’ve worked on, and am working on.

I’ve made the switchover…

I finally feel comfortable enough in WordPress that I have officially discontinued my old blog over at Blogger: http://warpcat.blogspot.com/ (although it’s still around of course)

At some point I’ll try and figure out how to import the old posts  over here, but in the meantime, long live WordPress! :)

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…