Skip to content

Instantly share code, notes, and snippets.

@nathanielanozie
Created October 14, 2014 11:34
Show Gist options
  • Save nathanielanozie/d076e4615a7c10fe4cae to your computer and use it in GitHub Desktop.
Save nathanielanozie/d076e4615a7c10fe4cae to your computer and use it in GitHub Desktop.
create ik sc use selected root, assumes has child (MEL)
//create ik sc use selected root, assumes has child
//inspired by Anop A.K (codecg dot com) learning about iksc drawing in mel
string $sel[] = `ls -sl`;
if(size($sel) == 1){
string $root = $sel[0];
select -r $root;
string $check[] =`listRelatives -children -type joint $root`;
if(size($check) != 1){ error("Error Nothing to Draw IK SC with, check end"); }
pickWalk -direction down;//using this so get full path
string $children[] = {};
$children = `ls -sl -type joint`;
if(size($children) != 1){print("Error Nothing to end IK SC at");}
else{
string $end = $children[0];
select -r $root $end; //make ik sc
ikHandle -sol ikRPsolver;
select -cl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment