
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I need to use the distance tool to get the distance between each joint in a joint chain (no matter how many joints is in the chain). These locators also need to have the position of each joint.
So far I can get the position of the locators with my current script below, but then the distance is made from locator2 to the rest of the locators...:
Is anyone able to help me?
//we have a joint chain name spine_a_fk_jnt spine_b_fk_jnt etc
select "spine_*_fk_jnt";
string $selected[] = `ls -sl`;
for ($i=1; $i<size($selected); $i++)
{
float $pos[] = `xform -q -ws -t $selected[$i]`;
distanceDimension -sp $pos[0] $pos[1] $pos[2] -ep $pos[3] $pos[4] $pos[5] ;
}
parent "locator2" "spine_a_fk_jnt";
select -r "locator2";
setAttr "locator2.translateX" 0;
setAttr "locator2.translateY" 0;
setAttr "locator2.translateZ" 0;
Solved! Go to Solution.