So I only worked for a few hours on the project last night before I passed out, I really need to catch up on my sleep. Got the logic and the basic code in creating the laser completed. Here is the procedure thus far…
proc turretFire () {
int $curTime = `currentTime -q`; //Get the current frame number
string $crvName = "TurAnim_Path_" + $curTime; //naming scheme
string $cylName = "TurAnim_Cylndr_" + $curTime;
// Will add an If statement here to determine if a beam already exists for this frame.
duplicate -n $crvName -rr beamAut_TemplCurve; //duplicate the template curve
$PCTemp = `pointConstraint LeftGunLaserBeamAimLocator $crvName`;
$OCTemp = `orientConstraint LeftGunLaserBeamAimLocator $crvName`;
//Orient and Point constrain the curve to the turret locator
delete $PCTemp;
delete $OCTemp; //delete the constraints
cylinder -ax 0 0 1 -r .125 -hr 9 -ch 1 -n $cylName; nurbsPrimitiveCap 3 1 0;
objectMoveCommand; // creates the laser beam geometry
pathAnimation -fractionMode true -follow true -followAxis z -upAxis y -startTimeU
$curTime -endTimeU ($curTime + 30) $crvName $cylName;
//sets up the animation of the beam along the curve
setAttr ($crvName + "Shape.overrideVisibility") 1; //Make the curve visasable
sets -e -forceElement LaserSG $cylName; //assign the Laser Shader to the beam geometry
}
Thats it for now. Tonight will be adding in the if statement and creating the tab layout as well as building all the code for the ability to gather all the laser beams in the scene and allowing the user to change global settings of animation duration as well as giving control to hide and delete setups.
No comments:
Post a Comment