PDA

View Full Version : MEL Script that Connects Ctrl Jts to Bind Jts?


angelodcollazo
07-10-2008, 03:42 PM
I'm rigging a character.
I've made a control skeleton and a bind skeleton with corresponding names.
For example, "ctrlJt_root" corresponds to "bindJt_root".
I need the control skeleton's rotates connected to the corresponding bind skeleton's rotates.
Do you know of any script that can do this for me?
Thank you for your help.

Fl2IDay
07-11-2008, 01:48 AM
$allJnts = `ls -type "joint"`;

string $ctrlJnts[];

for($eachJnt in $allJnts){
$tmpArray = stringToStringArray($eachJnt, "_");
if($tmpArray[0] == "ctrlJt")
$ctrlJnts[`size($ctrlJnts)`] = $eachJnt;
}

for($eachCtrlJnt in $ctrlJnts){
$tmpArray = stringToStringArray($eachCtrlJnt, "_");
connectAttr ($eachCtrlJnt+".r") ("bindJt_"+$tmpArray[1]+".r");
}

Boucha
07-19-2008, 01:05 PM
// make sure to select ctrlJt and then shift selecct the bindJT

global proc doIt () {
string $sel[] = `ls -sl`;
letsConnect $sel[0] $sel[1];
}

proc letsConnect (string $ctrlJtl, string $bindJt)
{
pointConstraint $ctrlJt $bindJt;
orientConstraint $ctrlJt $bindJt;
}

// You can also create custom message attributes on control and bound joints

//Thanks

CGTalk Moderation
07-19-2008, 01:05 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.