Friday, January 23, 2015

Control curves template

I made another simple little utility/template file for rigging purposes. It's pretty common to have to make control curves of various shapes to use in rigs.


Download the maya template here (it is a 2015 file, but checking ignore version should be okay): http://goo.gl/h3rNmU

All you need to do for your rig file is import the maya file (merge into the default namespace), open up the template group, select the one you want, and then run this script:

string $dupCtrlList[] = `duplicate -rr`; //duplicate control
for ($duplicateCtrl in $dupCtrlList){
  parent -w $duplicateCtrl; //unparent from template group
  editDisplayLayerMembers -noRecurse "defaultLayer" $duplicateCtrl; //remove from display layer
  string $shapeNodes[] = `listRelatives -s -path $duplicateCtrl`; //get list of shape nodes
  for ($shape in $shapeNodes){ //for each shape node, connect display overrides
    connectAttr -f ($duplicateCtrl + ".wireOverride") ($shape + ".overrideEnabled");
    connectAttr -f ($duplicateCtrl + ".wireColor") ($shape + ".overrideColor");
  }
}
I've put this script on my shelf with this nice little circle icon:

The control curves each have additional attributes that let you set the drawing color override, as in the image above, which is a nice visual indicator for rigs.

Hope that's useful for someone.

Later,
Stuart

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete