Tuesday, June 24, 2014

Make secondary rigs faster using MEL

Hi,

I ran into a situation where i wanted to add joints to the lips and eyes to allow offset controls but it was taking some time orienting each joint to glide along the surface and then repeatedly zeroing out rotates then doing a reparenting to zero out translates.

Here are a couple lines of MEL that may be helpful doing this automatically.  Both assume you have already rotate joints how you want them to move on surface.

1. select joints then in MEL script editor type
makeIdentity -apply true -t 0 -r 1 -s 0 -n 0;

2. select all joints then type:
(it makes duplicate of each thing selected and parent to each thing selected)
//assumes no issues finding joint on scene 
string $sel[] = `ls -sl`;
for($arg in $sel){
//string $arg = "lip_all";
string $dup_ar[] = `duplicate -rr $arg`;
parent $dup_ar[0] $arg;
}

Hope you find this helpful

cheers,
Nate