followThough w/Exp

Hey everybody, I don't know if this is the right place for this but I guess I'll ask ya.... I want to create a follow through on an object...Try to imagine this scenario...I have A camera(not a maya cam, but modeled geometry) that revolves around the y axis, there is a wire that comes out of the back and connects to a circular track that is on a disk that is on top of the camera...Now when the camera body rotate's I want the wire to rotate around it's track with it...So it won't pull out of the camera...I have it setup so it rotates fine, but it follows the camera rotation exactly..I want to write a script or expression the once the camera body starts to move, the wire will follow about 10 frames later and come to a final resting position equal to the rotation of the camera body...I got somewhat of the result I want with a smoothstep but when the cam rotate's in neg it get's messed up then rest at the final pos...If anyone can Help I would really appreciate it and If ya just took the time to read this, Thanks again....

The two following scripts add rotation and translate accelleration attributes to an object, and might be what you need. Also check out the Jiggle mel script in the animation section here on highend3d

Ragnar

// Creates translate accelleration attributes and expression on selected object //

string $sel[] = ls -sl;
addAttr -ln AccTrnsX -at double $sel[0];
setAttr -e -keyable true ($sel[0] + ".AccTrnsX" );
addAttr -ln AccTrnsY -at double $sel[0];
setAttr -e -keyable true ($sel[0] + ".AccTrnsY" );
addAttr -ln AccTrnsZ -at double $sel[0];
setAttr -e -keyable true ($sel[0] + ".AccTrnsZ" );

string $thisObj = $sel[0];
string $cmdString = "float $VelXa = getAttr -t ( frame - 2 ) "+$thisObj+".tx - "+$thisObj+".tx;n";
$cmdString = $cmdString + "float $VelYa = getAttr -t ( frame - 2 ) "+$thisObj+".ty - "+$thisObj+".ty;n";
$cmdString = $cmdString + "float $VelZa = getAttr -t ( frame - 2 ) "+$thisObj+".tz - "+$thisObj+".tz;n";
$cmdString = $cmdString + "float $VelYa = getAttr -t ( frame - 2 ) "+$thisObj+".ty - "+$thisObj+".ty;n";
$cmdString = $cmdString + "float $VelXb = "+$thisObj+".tx - getAttr -t ( frame + 2 ) "+$thisObj+".tx;n";
$cmdString = $cmdString + "float $VelYb = "+$thisObj+".ty - getAttr -t ( frame + 2 ) "+$thisObj+".ty;n";
$cmdString = $cmdString + "float $VelZb = "+$thisObj+".tz - getAttr -t ( frame + 2 ) "+$thisObj+".tz;n";
$cmdString = $cmdString + $thisObj+".AccTrnsX = $VelXb - $VelXa ;n";
$cmdString = $cmdString + $thisObj+".AccTrnsY = $VelYb - $VelYa ;n";
$cmdString = $cmdString + $thisObj+".AccTrnsZ = $VelZb - $VelZa ;";
$thisObj = $thisObj + "TrnsExp";
expression -n $thisObj -ae false -s $cmdString;

// Creates rotate accelleration attributes and expression on selected object //

string $sel[] = ls -sl;
addAttr -ln AccRotX -at double $sel[0];
setAttr -e -keyable true ($sel[0] + ".AccRotX" );
addAttr -ln AccRotY -at double $sel[0];
setAttr -e -keyable true ($sel[0] + ".AccRotY" );
addAttr -ln AccRotZ -at double $sel[0];
setAttr -e -keyable true ($sel[0] + ".AccRotZ" );

string $thisObj = $sel[0];
string $cmdString = "float $VelXa = getAttr -t ( frame - 2 ) "+$thisObj+".rx - "+$thisObj+".rx;n";
$cmdString = $cmdString + "float $VelYa = getAttr -t ( frame - 2 ) "+$thisObj+".ry - "+$thisObj+".ry;n";
$cmdString = $cmdString + "float $VelZa = getAttr -t ( frame - 2 ) "+$thisObj+".rz - "+$thisObj+".rz;n";
$cmdString = $cmdString + "float $VelYa = getAttr -t ( frame - 2 ) "+$thisObj+".ry - "+$thisObj+".ry;n";
$cmdString = $cmdString + "float $VelXb = "+$thisObj+".rx - getAttr -t ( frame + 2 ) "+$thisObj+".rx;n";
$cmdString = $cmdString + "float $VelYb = "+$thisObj+".ry - getAttr -t ( frame + 2 ) "+$thisObj+".ry;n";
$cmdString = $cmdString + "float $VelZb = "+$thisObj+".rz - getAttr -t ( frame + 2 ) "+$thisObj+".rz;n";
$cmdString = $cmdString + $thisObj+".AccRotX = $VelXb - $VelXa ;n";
$cmdString = $cmdString + $thisObj+".AccRotY = $VelYb - $VelYa ;n";
$cmdString = $cmdString + $thisObj+".AccRotZ = $VelZb - $VelZa ;";
$thisObj = $thisObj + "RotExp";
expression -n $thisObj -ae false -s $cmdString;