Monday, September 30, 2013

Holo Camera Rig Script V2

I have done a very minor update to the camera rig script I've been working on. This update adds a short dialog box telling the user to not adjust the camera angles and tells them how they should set up the render. This new version also locks the cameras from moving.


//Dialog Box
{
// create a confirm dialog with a yes and no button. Specif
$response = `confirmDialog -title "Hologram Creator" 
              -message "I will now make the rig for you to create holograms. Please do not adjust the angles of the camera. Feel free to parent the rig to the main focus of your animation. Be sure to render out every camera separately within the render settings and be sure to render it out as a square resolution. Got That?"
              -button "Yes" 
              -button "No"
              -defaultButton "Yes"
              -cancelButton "No"
              -dismissString "No"`;
// check response  
if( $response == "Yes" ) {
print("User says yes\n");
camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 0.4036 -horizontalFilmAperture 1.4173 -horizontalFilmOffset 0 -verticalFilmAperture 0.9449 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.1 -farClipPlane 10000 -orthographic 0 -orthographicWidth 30 -panZoomEnabled 0 -horizontalPan 0 -verticalPan 0 -zoom 1; objectMoveCommand; cameraMakeNode 1 "";
// camera1 // 
displaySmoothness -divisionsU 1 -divisionsV 1 -pointsWire 8 -pointsShaded 2 -polygonObject 2;
setAttr "camera1.translateZ" 27;
camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 0.4036 -horizontalFilmAperture 1.4173 -horizontalFilmOffset 0 -verticalFilmAperture 0.9449 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.1 -farClipPlane 10000 -orthographic 0 -orthographicWidth 30 -panZoomEnabled 0 -horizontalPan 0 -verticalPan 0 -zoom 1; objectMoveCommand; cameraMakeNode 1 "";
// camera2 // 
setAttr "camera2.translateX" 27;
setAttr "camera2.rotateY" 90;
camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 0.4036 -horizontalFilmAperture 1.4173 -horizontalFilmOffset 0 -verticalFilmAperture 0.9449 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.1 -farClipPlane 10000 -orthographic 0 -orthographicWidth 30 -panZoomEnabled 0 -horizontalPan 0 -verticalPan 0 -zoom 1; objectMoveCommand; cameraMakeNode 1 "";
// camera3 // 
setAttr "camera3.translateZ" -27;
setAttr "camera3.rotateY" 180;
camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 0.4036 -horizontalFilmAperture 1.4173 -horizontalFilmOffset 0 -verticalFilmAperture 0.9449 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.1 -farClipPlane 10000 -orthographic 0 -orthographicWidth 30 -panZoomEnabled 0 -horizontalPan 0 -verticalPan 0 -zoom 1; objectMoveCommand; cameraMakeNode 1 "";
// camera4 // 
setAttr "camera4.translateX" -27;
setAttr "camera4.rotateY" -90;
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 1 -tol 0.01 -s 8 -ch 1; objectMoveCommand;
setAttr "nurbsCircle1.scaleZ" 27;
setAttr "nurbsCircle1.scaleX" 27;
setAttr "nurbsCircle1.scaleY" 27;
select -r camera1 ;
select -tgl camera2 ;
select -tgl camera3 ;
select -tgl camera4 ;
select -tgl nurbsCircle1 ;
parent;
// camera1 camera2 camera3 camera4 // 
select -r nurbsCircle1 ;
rename "nurbsCircle1" "CameraRig";
// CameraRig //
// Lock Camera Movement //
select -r camera1 ;
setAttr -lock true "camera1.rx";
setAttr -lock true "camera1.ry";
setAttr -lock true "camera1.rz";
setAttr -lock true "camera1.tx";
setAttr -lock true "camera1.ty";
setAttr -lock true "camera1.tz";
select -r camera2 ;
setAttr -lock true "camera2.tx";
setAttr -lock true "camera2.ty";
setAttr -lock true "camera2.tz";
setAttr -lock true "camera2.rx";
setAttr -lock true "camera2.ry";
setAttr -lock true "camera2.rz";
select -r camera3 ;
setAttr -lock true "camera3.tx";
setAttr -lock true "camera3.ty";
setAttr -lock true "camera3.tz";
setAttr -lock true "camera3.rx";
setAttr -lock true "camera3.ry";
setAttr -lock true "camera3.rz";
select -r camera4 ;
setAttr -lock true "camera4.tx";
setAttr -lock true "camera4.ty";
setAttr -lock true "camera4.tz";
setAttr -lock true "camera4.rx";
setAttr -lock true "camera4.ry";

setAttr -lock true "camera4.rz";


} else if( $response == "No" ) {
print("User says no\n");
}  
}


//End Dialog Box

No comments:

Post a Comment