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: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");
}
}
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
This comment has been removed by a blog administrator.
ReplyDelete