// =========================================================================== // 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: // performCompositeTest // // Description: // // // Input Arguments: // $option : Whether to set the options to default values. // Return Value: // None // proc setOptionVars (int $forceFactorySettings) { if ($forceFactorySettings || !`optionVar -exists "compositeTestMapX"`) optionVar -intValue "compositeTestMapX" 256; if ($forceFactorySettings || !`optionVar -exists "compositeTestMapY"`) optionVar -intValue "compositeTestMapY" 256; } global proc compositeTestSetup (string $parent, int $forceFactorySettings) { setOptionVars($forceFactorySettings); setParent $parent; intSliderGrp -edit -value `optionVar -query compositeTestMapX` compositeTestMapX; intSliderGrp -edit -value `optionVar -query compositeTestMapY` compositeTestMapY; } global proc compositeTestCallback (string $parent, int $doIt) { setParent $parent; optionVar -intValue "compositeTestMapX" `intSliderGrp -query -value compositeTestMapX`; optionVar -intValue "compositeTestMapY" `intSliderGrp -query -value compositeTestMapY`; if ($doIt) { performCompositeTest 0; string $tmpCmd = "performCompositeTest 0 "; addToRecentCommandQueue $tmpCmd "Test Current Render Node"; } } proc compositeTestOptions () { string $commandName = "compositeTest"; string $callback = ($commandName + "Callback"); string $setup = ($commandName + "Setup"); // STEP 1: Get the option box. // ============================ // string $layout = getOptionBox(); setParent $layout; // STEP 2: Pass the command name to the option box. // ================================================= // setOptionBoxCommandName($commandName); // STEP 3: Activate the default UI template. // ========================================== // setUITemplate -pushTemplate DefaultTemplate; // STEP 4: Create option box contents. // =================================== // waitCursor -state 1; string $parent = `columnLayout -adjustableColumn 1`; frameLayout -label (uiRes("m_performCompositeTest.kImage")) -borderStyle "etchedIn" -collapsable 0; columnLayout; intSliderGrp -field on -label (uiRes("m_performCompositeTest.kXResolution")) -minValue 1 -maxValue 1024 -fieldMinValue 1 -fieldMaxValue 4096 -value 256 compositeTestMapX; intSliderGrp -field on -label (uiRes("m_performCompositeTest.kYResolution")) -minValue 1 -maxValue 1024 -fieldMinValue 1 -fieldMaxValue 4096 -value 256 compositeTestMapY; setParent ..; setParent ..; //copyAttrib setParent -menu ..; waitCursor -state 0; // Step 5: Deactivate the default UI template. // =========================================== // setUITemplate -popTemplate; // Step 6: Customize the buttons. // ============================== // string $applyBtn = getOptionBoxApplyBtn(); button -edit -label (uiRes("m_performCompositeTest.kApply")) -command ($callback + " " + $parent + " " + 1) $applyBtn; string $applyAndCloseBtn = getOptionBoxApplyAndCloseBtn(); button -edit -label (uiRes("m_performCompositeTest.kTestTexture")) $applyAndCloseBtn; string $saveBtn = getOptionBoxSaveBtn(); button -edit -command ($callback + " " + $parent + " " + 0 + " " +"; hideOptionBox") $saveBtn; string $resetBtn = getOptionBoxResetBtn(); button -edit -command ($setup + " " + $parent + " " + 1) $resetBtn; // Step 7: Set the option box title. // ================================= // setOptionBoxTitle (uiRes("m_performCompositeTest.kTestTextureOptions")); setOptionBoxHelpTag( "HypershadeTestTexture" ); // Step 8: Customize the 'Help' menu item text. // ============================================ // eval (($setup + " " + $parent + " " + 0)); // Step 9: Show the option box. // ============================= // showOptionBox(); } proc string assembleCmd() { setOptionVars (false); int $doHistory = `constructionHistory -q -toggle`; string $cmd = "compositeTest "; $cmd += `optionVar -query "compositeTestMapX"`; $cmd += " "; $cmd += `optionVar -query "compositeTestMapY"`; return $cmd; } global proc string performCompositeTest (int $option) { string $cmd=""; switch ($option) { case 0: $cmd = `assembleCmd`; evalEcho($cmd); break; case 1: compositeTestOptions; break; case 2: $cmd = `assembleCmd`; break; } return $cmd; }