// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Procedure Name: // buildStereoCameraSetLookthruMenu // // Description: // This procedure creates a menu item for each stereo CameraSet node. When a menu item is selected, // the associated cameraSet will be placed in the model view. // // Input Arguments: // parent - menu name to build menu items for // panel - name of panel this menu is associated with // // Return Value: // None. // // Make sure this script is loaded so its procedures can be called. source "buildStereoLookthruMenu.mel"; // Wrapper to switch to cameraSet. Use in conjunction with look through. // global proc stereoCameraSetSwitchToCameraSet( string $cameraSet, string $panel ) { global int $gCameraSetUsed; global string $gBuildCameraSetChosenCameraSet; if ( `pluginInfo -query -loaded "stereoCamera"` ) { string $panelEditor = "StereoPanelEditor"; // Switch the panel switchToStereoPanel( $panel ); python("from maya.app.stereo import stereoCameraCustomPanel"); python("stereoCameraCustomPanel.switchToCameraSet\(\"" + $cameraSet + "\"," + "\"" + $panelEditor + "\")"); $gBuildCameraSetChosenCameraSet = $cameraSet; $gCameraSetUsed = true; } } global proc buildStereoCameraSetLookthruMenu( string $parent, string $panel ) // // Description: // This procedure builds the Panel->Camera Sets submenu. The menu consists of a // checkbox item for whether to select the cameraSet when it is chosen, followed // by the list of available cameraSets. // { if ( !`pluginInfo -query -loaded "stereoCamera"` ) loadPlugin -qt "stereoCamera"; python("from maya.app.stereo import stereoCameraMenus"); if (!`optionVar -exists toggleChosenCameraSetSelection`) { optionVar -intValue toggleChosenCameraSetSelection 0; } //string $cameraSets[] = `ls -type cameraSet`; // Rebuild the menu. setParent -m $parent; menu -e -deleteAllItems $parent; string $pyCmdRig = ("'stereoCameraSetSwitchToCameraSet %(arg1)s "+$panel+"'"); python("stereoCameraMenus.createStereoCameraSetSubmenus("+$pyCmdRig+")"); }