// ************************************************************************ // // Spoon Camera Projection Utilities // // Version: 0.1.0 // Date: 06.06.07 // Author: Sebastian H. Schmidt // Contact: sebastian.schmidtsubsitesorg // www: www.subsites.org // // Descr: Creates a new camera with on screen ui elements to control overscan and horizontal/vertical Film Offset // Use SHS_ProjUtilCam to display the UI on screen // // // CMD: shs_resetCamProjUtil -- Sets the UI Slider to Zero // shs_spoonCamProjUtil -- Creates Camera Thing // // ************************************************************************ global proc shs_resetCamProjUtil() { setAttr Zoom.translateX 0.0; setAttr Zoom.translateY 0.0; setAttr Zoom.translateZ 0.0; setAttr Offset.translateX 0.0; setAttr Offset.translateY 0.0; setAttr Offset.translateZ 0.0; } global proc shs_spoonCamProjUtil() { string $DisplayCam[] = `camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 1 -horizontalFilmAperture 1.41732 -horizontalFilmOffset 0 -verticalFilmAperture 0.94488 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.01 -farClipPlane 1000 -orthographic 0 -orthographicWidth 30 -n "SHS_ProjUtilCam"`; string $CameraName[] = `camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 1 -horizontalFilmAperture 1.41732 -horizontalFilmOffset 0 -verticalFilmAperture 0.94488 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.01 -farClipPlane 1000 -orthographic 0 -orthographicWidth 30`; string $WorkLayer = `createDisplayLayer -name "UI_Work" -number 1 -empty`; string $BG_Layer = `createDisplayLayer -name "UI_BG" -number 1 -empty`; setAttr ($WorkLayer +".color") 18; setAttr ($BG_Layer +".color") 1; shs_projUI; select -r Offset Zoom; editDisplayLayerMembers -noRecurse $WorkLayer `ls -sl`; select -r Offset_Area Zoom_Area Zoom_Out Zoom_In Zoom_Nulll Zoom_In_33 Zoom_In_66 ; editDisplayLayerMembers -noRecurse $BG_Layer `ls -sl`; layerEditorLayerButtonTypeChange $BG_Layer; layerEditorLayerButtonTypeChange $BG_Layer; select -r $CameraName[0]; setDrivenKeyframe -at overscan - cd Zoom.translateZ; string $curveName = ($CameraName[1] + "_overscan"); setKeyframe -float -4.5 -value 2.0 $curveName; setKeyframe -float 15 -value 0.01 $curveName; select -r $CameraName[0]; setDrivenKeyframe -at horizontalFilmOffset - cd Offset.translateX; setDrivenKeyframe -at verticalFilmOffset - cd Offset.translateZ; string $VerticalCurveName = ($CameraName[1] + "_horizontalFilmOffset"); string $HorizontalCurveName = ($CameraName[1] + "_verticalFilmOffset"); setKeyframe -float -10 -value -1 $VerticalCurveName; setKeyframe -float 10 -value 1 $VerticalCurveName; setKeyframe -float -10 -value 1 $HorizontalCurveName; setKeyframe -float 10 -value -1 $HorizontalCurveName; $UtilNode = `createNode transform -n "SHS_SpoonProjUI"`; parent "SHS_ProjHelp" "SHS_SpoonProjUI"; parent $DisplayCam[1] "SHS_SpoonProjUI"; setAttr ($UtilNode + ".t") -type "double3" 5000.0 5000.0 5000.0 ; select -r $CameraName[1]; } global proc shs_projUI() { createNode transform -n "SHS_ProjHelp"; setAttr ".t" -type "double3" 0.0 0.0 -2.5 ; setAttr ".r" -type "double3" 90 0 0 ; setAttr ".s" -type "double3" 0.01 0.01 0.01 ; createNode transform -n "Offset_Area" -p "SHS_ProjHelp"; setAttr ".rp" -type "double3" 1.4210854715202004e-014 8.5265128291212022e-014 1.4210854715202004e-014 ; setAttr ".sp" -type "double3" 1.4210854715202004e-014 8.5265128291212022e-014 1.4210854715202004e-014 ; setAttr ".mntl" -type "double3" 0 0 0 ; setAttr ".mxtl" -type "double3" 0 0 0 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "Offset_AreaShape" -p "Offset_Area"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 1 4 0 no 3 5 0 1 2 3 4 5 -10 0 10 10 0 10 10 0 -10 -10 0 -10 -10 0 10 ; createNode transform -n "Offset" -p "SHS_ProjHelp"; setAttr ".mntl" -type "double3" -10 0 -10 ; setAttr ".mxtl" -type "double3" 10 0 10 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "OffsetShape" -p "Offset"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 3 8 2 no 3 13 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 1.5259379910052409 9.3436753819095403e-017 -1.5259379910052386 -2.462022479557479e-016 1.3213952447508091e-016 -2.1580022022199641 -1.5259379910052395 9.3436753819095453e-017 -1.5259379910052395 -2.1580022022199641 3.8290728322993427e-032 -6.2533504925098281e-016 -1.52593799100524 -9.343675381909544e-017 1.5259379910052389 -6.5024817935524495e-016 -1.3213952447508093e-016 2.1580022022199645 1.5259379910052386 -9.3436753819095477e-017 1.5259379910052395 2.1580022022199641 -7.0972396364690678e-032 1.1590671925016162e-015 1.5259379910052409 9.3436753819095403e-017 -1.5259379910052386 -2.462022479557479e-016 1.3213952447508091e-016 -2.1580022022199641 -1.5259379910052395 9.3436753819095453e-017 -1.5259379910052395 ; createNode transform -n "Zoom_Area" -p "SHS_ProjHelp"; setAttr ".rp" -type "double3" 20.161390554591975 5.6843418860808015e-014 1.4210854715202004e-014 ; setAttr ".sp" -type "double3" 20.161390554591975 5.6843418860808015e-014 1.4210854715202004e-014 ; setAttr ".mntl" -type "double3" 0 0 0 ; setAttr ".mxtl" -type "double3" 0 0 0 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "Zoom_AreaShape" -p "Zoom_Area"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 1 4 0 no 3 5 0 1 2 3 4 5 19.449222158392757 0 10 20.873558950791164 0 10 20.873558950791164 0 -10 19.449222158392757 0 -10 19.449222158392757 0 10 ; createNode transform -n "Zoom" -p "SHS_ProjHelp"; setAttr ".rp" -type "double3" 20.048124315521235 0 -5.1710366043856872 ; setAttr ".sp" -type "double3" 20.048124315521235 0 -5.1710366043856872 ; setAttr ".mntl" -type "double3" 0 0 -4.5 ; setAttr ".mxtl" -type "double3" 0 0 15 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "ZoomShape" -p "Zoom"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 1 4 0 no 3 5 0 1 2 3 4 5 17.445654989333381 0 -4.5710365604922938 22.650593641709087 0 -4.5710365604922938 22.650593641709087 0 -5.7710366482790798 17.445654989333381 0 -5.7710366482790798 17.445654989333381 0 -4.5710365604922938 ; createNode transform -n "Zoom_Out" -p "SHS_ProjHelp"; setAttr ".rp" -type "double3" 20.162745662732277 5.6843418860808015e-014 -9.8751415228090238 ; setAttr ".sp" -type "double3" 20.162745662732277 5.6843418860808015e-014 -9.8751415228090238 ; setAttr ".mntl" -type "double3" 0 0 0 ; setAttr ".mxtl" -type "double3" 0 0 0 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "Zoom_OutShape" -p "Zoom_Out"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 1 4 0 no 3 5 0 1 2 3 4 5 19.450577266533074 0 -9.7480215231127918 20.874914058931481 0 -9.7480215231127918 20.874914058931481 0 -10.002261522505284 19.450577266533074 0 -10.002261522505284 19.450577266533074 0 -9.7480215231127918 ; createNode transform -n "Zoom_In" -p "SHS_ProjHelp"; setAttr ".rp" -type "double3" 20.162745662732277 5.6843418860808015e-014 9.8648685949121173 ; setAttr ".sp" -type "double3" 20.162745662732277 5.6843418860808015e-014 9.8648685949121173 ; setAttr ".mntl" -type "double3" 0 0 0 ; setAttr ".mxtl" -type "double3" 0 0 0 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "Zoom_InShape" -p "Zoom_In"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 1 4 0 no 3 5 0 1 2 3 4 5 19.450577266533074 0 9.9919885946083529 20.874914058931481 0 9.9919885946083529 20.874914058931481 0 9.7377485952158604 19.450577266533074 0 9.7377485952158604 19.450577266533074 0 9.9919885946083529 ; createNode transform -n "Zoom_Nulll" -p "SHS_ProjHelp"; setAttr ".rp" -type "double3" 20.162745662732277 5.6843418860808015e-014 -5.1702087315329379 ; setAttr ".sp" -type "double3" 20.162745662732277 5.6843418860808015e-014 -5.1702087315329379 ; setAttr ".mntl" -type "double3" 0 0 0 ; setAttr ".mxtl" -type "double3" 0 0 0 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "Zoom_NulllShape" -p "Zoom_Nulll"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 1 4 0 no 3 5 0 1 2 3 4 5 19.450577266533074 0 -5.0430887318367068 20.874914058931481 0 -5.0430887318367068 20.874914058931481 0 -5.2973287312291983 19.450577266533074 0 -5.2973287312291983 19.450577266533074 0 -5.0430887318367068 ; createNode transform -n "Zoom_In_33" -p "SHS_ProjHelp"; setAttr ".rp" -type "double3" 20.164909520095208 5.6843418860808015e-014 2.1316282072803006e-014 ; setAttr ".sp" -type "double3" 20.164909520095208 5.6843418860808015e-014 2.1316282072803006e-014 ; setAttr ".mntl" -type "double3" 0 0 0 ; setAttr ".mxtl" -type "double3" 0 0 0 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "Zoom_In_Shape33" -p "Zoom_In_33"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 1 4 0 no 3 5 0 1 2 3 4 5 19.452741123895997 0 0.12711999969625254 20.877077916294404 0 0.12711999969625254 20.877077916294404 0 -0.12711999969623911 19.452741123895997 0 -0.12711999969623911 19.452741123895997 0 0.12711999969625254 ; createNode transform -n "Zoom_In_66" -p "SHS_ProjHelp"; setAttr ".rp" -type "double3" 20.162745662732291 5.6843418860808015e-014 4.6162577960115883 ; setAttr ".sp" -type "double3" 20.162745662732291 5.6843418860808015e-014 4.6162577960115883 ; setAttr ".mntl" -type "double3" 0 0 0 ; setAttr ".mxtl" -type "double3" 0 0 0 ; setAttr ".mtxe" yes; setAttr ".mtye" yes; setAttr ".mtze" yes; setAttr ".xtxe" yes; setAttr ".xtye" yes; setAttr ".xtze" yes; createNode nurbsCurve -n "Zoom_In_Shape66" -p "Zoom_In_66"; setAttr -k off ".v"; setAttr ".cc" -type "nurbsCurve" 1 4 0 no 3 5 0 1 2 3 4 5 19.450577266533081 0 4.7433777957078185 20.874914058931488 0 4.7433777957078185 20.874914058931488 0 4.4891377963153269 19.450577266533081 0 4.4891377963153269 19.450577266533081 0 4.7433777957078185 ; }