/* Title: Shotmask v1.0 Author: Christiaan van den Bosch Date: November 8 2011 Descr: Creates a shotmask for the playblast. In order to work best you will need to do this: - Name your camera shotCam - Name your file like this: Name_##.ext (e.g. Dialog_23.ma, Class307_12.mb) - Set desired output resolution in Render Globals (Image Size -> Width and Height) How to Use: - type in this MEL command or create button: toi_shotMaskUI; - Delete the default name to remove name from shotmask, or change it. - Select the stage you are in (e.g. Blocking) - Toggle on/off ornaments like Axis and Camera name - create playblast: Blast! */ global proc toi_shotMask(string $stage) { string $project = `workspace -q -sn`; $project = basename( $project, "" ); string $name = `textField -q -tx ShotmaskWindow|ShotmaskLayout|Name`; if ($name != "") { $name = $name + " - "; } string $file = `file -q -shn -sn`; string $file = `basenameEx $file`; string $f[] = stringToStringArray($file, "_"); $cmd = ($project + " - " + $name + $f[0] + " - "+ $stage + " -"); if ((`headsUpDisplay -ex Shotmask`) == 1) { headsUpDisplay -e -l $cmd -s 5 -b 1 -lfs "large" -dfs "large" -c "currentTime -q" -atr Shotmask; } else { headsUpDisplay -l $cmd -s 5 -b 1 -lfs "large" -dfs "large" -c "currentTime -q" -atr Shotmask; } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// global proc toi_createPlayblast() { //file name string $file = `file -q -shn -sn`; string $file = `basenameEx $file`; // current camera settings int $gate = `camera -q -dr shotCamShape`; int $filmgate = `camera -q -dfg shotCamShape`; float $over = `camera -q -ovr shotCamShape`; // turning off gates camera -e -dfg 0 -dr 0 -ovr 1.0 shotCamShape; // getting output resolution string $resolution[] = `ls -rr`; $w = `getAttr ($resolution[0] + ".width")`; $h = `getAttr ($resolution[0] + ".height")`; // getting sound and playblast string $sound = `timeControl -q -s timeControl1`; if ($sound != "") { playblast -fmt movie -f $file -fo -s $sound -c none -cc 0 -v 1 -orn 1 -fp 4 -percent 100 -widthHeight $w $h; } if ($sound == "") { playblast -fmt movie -f $file -fo -c none -cc 0 -v 1 -orn 1 -fp 4 -percent 100 -widthHeight $w $h; } // resetting camera settings to initial settings camera -e -dr $gate -dfg $filmgate -ovr $over shotCamShape; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// global proc toi_shotMaskUI() { //If such a window already exists, destroy it. if (`window -exists ShotmaskWindow`) deleteUI ShotmaskWindow; //Create the window. window -title "toi_Shotmask" -wh 200 340 -s false ShotmaskWindow; columnLayout -adjustableColumn true ShotmaskLayout; text -label "Name"; $nameTextGrp = `textField -tx "YourName" Name`; separator; text -label "Planning Stage"; $Button1 = `button -l "Layout" -c "toi_shotMask(\"Layout\")"`; $Button2 = `button -l "Blocking" -c "toi_shotMask(\"Blocking\")"`; $Button3 = `button -l "Refining" -c "toi_shotMask(\"Refining\")"`; $Button4 = `button -l "Polishing" -c "toi_shotMask(\"Polishing\")"`; $Button5 = `button -l "Final" -c "toi_shotMask(\"Final\")"`; separator; text -label "Toggle other HUD elements"; button -l "Axis" -c "ToggleViewAxis"; button -l "Camera Name" -c "ToggleCameraNames"; separator; text -label "Delete Shot Mask"; button -l "Delete" -c "headsUpDisplay -rem Shotmask"; separator; text -label "Create Playblast"; button -l "Blast!" -c "toi_createPlayblast"; setParent ..; showWindow ShotmaskWindow; }