You don't need to use "Shape" as part of the camera name.
CODE
lookThroughModelPanel persp modelPanel2;
Coincidently, I was exploring camera manipulation earlier today - you might find this useful:
Here is a script which will open a floating window with a camera viewport. The script uses a camera named audienceCam, but you could substitute the name of any camera in your scene.CODE
{
if ( window -exists Audience
){
if ( window -q -vis Audience
){
window -e -vis 0 Audience;
} else {
window -e -vis 1 Audience;
}
} else {
// If the window doesn't exist, create it
window -retain Audience; //-tlc is topLeftCorner, -wh is widthHeight
paneLayout;// Attach Panel to window
string $curModelPanel = modelPanel "audienceCam"
;// Note that if executed w/out variable assigment, the panel name is not created.
lookThroughModelPanel AudienceCam audienceCam;// Look thru camName camPanelName
modelEditor -e -da "smoothShaded" -displayTextures on -allObjects 0 -polymeshes 1 -nurbsCurves 1 -nurbsSurfaces 1 -gr off -sel off audienceCam;// da is -displayAppearance
showWindow;
}
}
If you execute the script mulitple times, it will toggle the visibility of the window. If you close the window, the script will reopen it and I think it will be saved with your scene.
Note that this script creates a window and a model panel, to remove them from your scene, you would use this code:CODE
if(window -exists Audience
){deleteUI -window Audience;};
if(panel -exists audienceCam
){deleteUI -pnl audienceCam;};