Skip to content

Instantly share code, notes, and snippets.

@bboyle
Created May 13, 2015 15:33
Show Gist options
  • Save bboyle/59ee8efe26c6263ba959 to your computer and use it in GitHub Desktop.
Save bboyle/59ee8efe26c6263ba959 to your computer and use it in GitHub Desktop.
Creates 4 follow cams attached to selected object. (Thanks to Nicole Herr at AnimationMentor for this!)
$object = `ls -sl`;
float $wsPivot[] = `xform -q -ws -rp $object`;
select -cl;
camera -n "Follow_Cam_Top" -hc "viewSet -p %camera";
camera -n "Follow_Cam_Persp" -hc "viewSet -t %camera";
Group; xform -t $wsPivot[0] $wsPivot[1] $wsPivot[2];
$GroupSel = `ls -sl`;
rename $GroupSel Follow_Cam_Constraint;
select "Follow_Cam_Top1";
Group; xform -t $wsPivot[0] $wsPivot[1] $wsPivot[2];
$GroupSel02 = `ls -sl`;
rename $GroupSel02 Top_Cam_Constraint;
setAttr "Follow_Cam_Constraint|Follow_Cam_Persp1.translateZ" 100;
setAttr "Follow_Cam_Top1.translateY" 100;
setAttr "Follow_Cam_Top1.rotateX" -90;
camera -n "Follow_Cam_Side" -hc "viewSet -t %camera";
Group; xform -t $wsPivot[0] $wsPivot[1] $wsPivot[2];
$GroupSel = `ls -sl`;
rename $GroupSel Side_Cam_Constraint;
setAttr "Follow_Cam_Side1.translateX" 100;
setAttr "Follow_Cam_Side1.rotateY" 90;
camera -n "Follow_Cam_Angled" -hc "viewSet -t %camera";
Group; xform -t $wsPivot[0] $wsPivot[1] $wsPivot[2];
$GroupSel = `ls -sl`;
rename $GroupSel Angled_Cam_Constraint;
setAttr "Follow_Cam_Angled1.translateX" 80;
setAttr "Follow_Cam_Angled1.translateZ" 80;
setAttr "Follow_Cam_Angled1.rotateY" 45;
parentConstraint -mo -weight 1 $object Side_Cam_Constraint;
parentConstraint -mo -weight 1 $object Follow_Cam_Constraint;
parentConstraint -mo -weight 1 $object Top_Cam_Constraint;
parentConstraint -mo -weight 1 $object Angled_Cam_Constraint;
select -r Follow_Cam_Constraint Top_Cam_Constraint Side_Cam_Constraint Angled_Cam_Constraint ;
Group;
rename Cams;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment