// =========================================================================== // 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. // =========================================================================== // // // Creation Date: Jan 2000 // // Description: // // These procedures create the UI for the Preferences window. // - Each procedure should only create the UI. // - Create any optvars in "createPreferencesOptVars.mel" // - Set the state of the UI in the update procedures // found in updatePrefWndUI.mel // - Commands attached to controls should not change the // optionVar status as this will affect the cancel/reset. // // Note: If adding preferences, make sure to read // http://mayadocs.autodesk.com/maya/TechDoc/CodingGuides/addingPreferences.html // source workingTimeUtil; //---------------------------------------------------------------- // // Begin section of callback procedures // //---------------------------------------------------------------- global proc prefWndToggleShowPlaneHandles (int $on) { intSliderGrp -edit -enable $on manipPHO; manipOptions -showPlaneHandles $on; } global proc prefWndToggleShowPivotManipHandle (int $on) { intSliderGrp -edit -enable $on manipPRO; manipOptions -showPivotRotateHandle $on; } global proc prefApplyWorkingMode() { global string $gPreferenceWindow; setParent $gPreferenceWindow; global string $gModeOptionsMenu; if (size($gModeOptionsMenu) > 0) { string $menuSetLabel = `optionMenuGrp -q -v $gModeOptionsMenu`; workingMode(`findMenuSetFromLabel $menuSetLabel`); } } global proc setUpAxis(string $axis) { switch ($axis) { case "y": if (`upAxis -q -axis` != "y") { upAxis -axis y -rv; } break; case "z": if (`upAxis -q -axis` != "z") { upAxis -axis z -rv; } break; } } global proc toggleMenuBarsInPanels( int $state ) { global int $gUseMenusInPanels; $gUseMenusInPanels = $state; // Walk through all the panels and switch them // string $panels[] = `getPanel -allPanels`; string $panel; for ( $panel in $panels ) { // Don't toggle for the Material Viewer and the toggled Outliner, // since their menu bar visibility is fixed if(`panel -q -l $panel` != "ToggledOutliner" && !(`getPanel -typeOf $panel` == "scriptedPanel" && `scriptedPanel -q -type $panel` == "shaderBallPanel")) { panel -e -mbv $state $panel; } } } global proc setShowEditorInMainWindow( int $state ) // // Description: // This procedure is called when the Editor visibility check // box is toggled by the user. // // Set the visibility for the Editor in Main Window. // Doing so disables/enables the radio button group // that controls which editor is visible. // // Arguments: // state - The current value of the Editor in Main Window visibility // check box. // { // If $state is off hide all the editors if(false == $state) { setAttributeEditorVisible false; setToolSettingsVisible false; setChannelsLayersVisible false; setChannelsVisible false; setLayersVisible false; } else { if(`checkBoxGrp -query -value1 attributeEditorCheckBox`) { setAttributeEditorVisible true; } if(`checkBoxGrp -query -value1 toolSettingsCheckBox`) { setToolSettingsVisible true; } if(`optionVar -q channelsLayersSeparate`) { if(`checkBoxGrp -query -value1 channelsCheckBox`) { setChannelsVisible true; } if(`checkBoxGrp -query -value1 layersCheckBox`) { setLayersVisible true; } } else { if(`checkBoxGrp -query -value1 channelsLayersCheckBox`) { setChannelsLayersVisible true; } } } checkBoxGrp -edit -enable $state attributeEditorCheckBox; checkBoxGrp -edit -enable $state toolSettingsCheckBox; int $enableSeparateChannelsLayers = ($state && `optionVar -q channelsLayersSeparate`); int $enableChannelsLayersTogether = ($state && !`optionVar -q channelsLayersSeparate`); checkBoxGrp -edit -enable $enableSeparateChannelsLayers channelsCheckBox; checkBoxGrp -edit -enable $enableSeparateChannelsLayers layersCheckBox; checkBoxGrp -edit -enable $enableChannelsLayersTogether channelsLayersCheckBox; } global proc prefExprEdTextEditor(int $isStartup) { int $whichEditor = `optionMenuGrp -q -sl textEdOpts`; optionVar -iv "EEexprEdTextEditor" $whichEditor; if (!$isStartup && $whichEditor == 6) { string $theMessage; string $winEditor = getenv("WINEDITOR"); if (size($winEditor) == 0) { $theMessage = (uiRes("m_createPrefWndUI.kSetEnvVariable")); } else { $theMessage = (uiRes("m_createPrefWndUI.kSetEditorWarn")); $theMessage = `format -s $winEditor $theMessage`; } string $close = (uiRes("m_createPrefWndUI.kClose")); confirmDialog -title (uiRes("m_createPrefWndUI.kInformation")) -ma "left" -message $theMessage -button $close -cancelButton $close -parent uiPreferenceWindow; } } global proc prefMultiTouchUseTrackpad() { int $setting = `optionMenuGrp -query -select multiTouchTrackpadOpt`; optionVar -iv "trackpadSetting" $setting; multiTouch -trackpad $setting; } global proc string linearUnits_uiToMel( string $ui ) { string $millimeter = uiRes("m_createPrefWndUI.kMillimeter"); string $centimeter = uiRes("m_createPrefWndUI.kCentimeter" ); string $meter = uiRes("m_createPrefWndUI.kMeter"); string $inch = uiRes("m_createPrefWndUI.kInch"); string $foot = uiRes("m_createPrefWndUI.kFoot"); string $yard = uiRes("m_createPrefWndUI.kYard"); string $result = $ui; if( $ui == $millimeter){ $result = "millimeter"; } else if( $ui == $centimeter ) { $result = "centimeter"; } else if( $ui == $meter ) { $result = "meter"; } else if( $ui == $inch ) { $result = "inch"; } else if( $ui == $foot ) { $result = "foot"; } else if( $ui == $yard ) { $result = "yard"; } else { uiToMelMsg( "linearUnits_uiToMel", $ui, 1 ); } return $result; } global proc float getCadenceLineWorkingUnitInFPS() { // If we are not frame based(ms,sec,min,hour), currentTimeUnitToFPS returns 0 // Default cadence line frequency to 1 in those cases float $fps; string $unit = `currentUnit -q -time`; if( $unit == "millisec" ) { $fps = 1000; } else if( $unit == "sec" ) { $fps = 1; } else if( $unit == "min" ) { $fps = 0.01667; } else if( $unit == "hour" ) { $fps = 0.00027; } else { $fps = currentTimeUnitToFPS(); } return ($fps); } global proc prefWndUnitsChanged(string $whichUnits) { global string $gPreferenceWindow; setParent $gPreferenceWindow; if ("linear" == $whichUnits) { string $linearUnit = linearUnits_uiToMel(`optionMenuGrp -q -v linearOpts`); changeLinearUnit($linearUnit); } else if ("angular" == $whichUnits) { if (`optionMenuGrp -q -sl angularOpts` == 1) { currentUnit -a degree; } else { currentUnit -a radian; } } } global proc prefWndTimeUnitsChanged(string $callerWidget) { int $which = 0; int $updateAnimation = 0; if($callerWidget == "timeOpts") { $which = `optionMenuGrp -q -sl timeOpts`; $updateAnimation = !`checkBoxGrp -query -value1 updateKeys`; // Reset the state of the updateKeys checkBox checkBoxGrp -edit -value1 off updateKeys; } else if($callerWidget == "timeSliderTimeOpts") { $which = `optionMenuGrp -q -sl timeSliderTimeOpts`; $updateAnimation = !`checkBoxGrp -query -value1 timeSliderUpdateKeys`; // Reset the state of the updateKeys checkBox checkBoxGrp -edit -value1 off timeSliderUpdateKeys; } string $currentUnitCmdValue = getCurrentUnitCmdValue($which); currentUnit -t $currentUnitCmdValue -updateAnimation $updateAnimation; // Changing the current time unit has side // effects so we need to update some optionVars optionVar -fv playbackMin `playbackOptions -q -min` -fv playbackMax `playbackOptions -q -max`; // Update the cadence line frequency if it's using the working units int $type = `optionVar -q animEdCadenceLineType`; if (1 == $type) { // Working Units updateCadenceLineWorkingUnit(); } } global proc dynPrefSetRunup( int $state ) // // Description: // Set the state of the runup preference. // { dynPref -rt $state; radioButtonGrp -e -enable $state dynRunupFrom; } global proc prefWndAnimOptionChanged( int $setSpeed ) { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $which; float $speed; int $enableBy = 0; float $fps = currentTimeUnitToFPS(); float $otherVal = `floatField -query -value playbackSpeedFF`; if ($fps != 0) { $otherVal /= $fps; } $which = `optionMenu -q -sl speedOpts`; switch ($which) { case 1: $speed = 0.0; $enableBy = 1; break; case 2: $speed = 1.0; break; case 3: $speed = 0.5; break; case 4: $speed = 2.0; break; case 5: $speed = $otherVal; break; default: $speed = 0.0; break; } float $maxSpeed = 0.0; int $whichMax = `optionMenuGrp -q -sl maxSpeedOpts`; switch ($whichMax) { case 1: $maxSpeed = 0.0; break; case 2: $maxSpeed = 1.0; break; case 3: $maxSpeed = 0.5; break; case 4: $maxSpeed = 2.0; break; } if( $setSpeed ) { playbackOptions -playbackSpeed $speed; text -edit -enable ($which == 5) playbackSpeedT; floatField -edit -enable ($which == 5) playbackSpeedFF; rowLayout -edit -enable $enableBy playbackByRow; optionMenuGrp -edit -enable $enableBy maxSpeedOpts; if ($enableBy) { playbackOptions -maxPlaybackSpeed $maxSpeed; } } // Now update the UI to indicate the frames-per-second values as well // // Only change the labels on the menu items if it makes // sense to. // string $realTimeLabel = (uiRes("m_createPrefWndUI.kRealTime")); string $halfTimeLabel = (uiRes("m_createPrefWndUI.kHalf")); string $twiceTimeLabel = (uiRes("m_createPrefWndUI.kTwice")); string $otherTimeLabel = (uiRes("m_createPrefWndUI.kOtherOption")); // Get a formatted string to display the current FPS // If the returned string is null, this is because we are in seconds, minutes.... string $timeUnitStr = currentTimeUnitToDisplayFPSString(); if( size($timeUnitStr) > 0 ) { $realTimeLabel = (uiRes("m_createPrefWndUI.kRealTimeFps")); $realTimeLabel = `format -s ($timeUnitStr) $realTimeLabel`; $halfTimeLabel = (uiRes("m_createPrefWndUI.kHalfFps")); $halfTimeLabel = `format -s ($timeUnitStr) $halfTimeLabel`; $twiceTimeLabel = (uiRes("m_createPrefWndUI.kTwiceFps")); $twiceTimeLabel = `format -s ($timeUnitStr) $twiceTimeLabel`; if( ! equivalent( 0.0, $otherVal ) ) { $otherTimeLabel = (uiRes("m_createPrefWndUI.kOtherFps")); $otherTimeLabel = `format -s ($fps*$otherVal) $otherTimeLabel`; } } menuItem -e -label (uiRes("m_createPrefWndUI.kPlayEveryFrame")) playbackSpeedFree; menuItem -e -label $realTimeLabel playbackSpeedNormal; menuItem -e -label $halfTimeLabel playbackSpeedHalf; menuItem -e -label $twiceTimeLabel playbackSpeedTwice; menuItem -e -label $otherTimeLabel playbackSpeedOther; menuItem -e -label $realTimeLabel maxPlaybackSpeedNormal; menuItem -e -label $halfTimeLabel maxPlaybackSpeedHalf; menuItem -e -label $twiceTimeLabel maxPlaybackSpeedTwice; // Update the playbackSpeed HUD. // if (`exists updatePlaybackSpeedHUD`) { updatePlaybackSpeedHUD(); } } // // Update the playback looping radio button based on the playbackOptions cmd // This function is attached to the playbackModeChanged event // global proc updatePlaybackLoopingRadioButton() { string $looping = `playbackOptions -q -loop`; $which = ($looping == "once") ? 1 : (($looping == "oscillate") ? 2 : 3); radioButtonGrp -e -sl $which playbackLooping; } // // Update frame rate lists // global proc prefWndUpdateFrameRateList() { int $index = getIndexFromCurrentUnitCmdValue( `currentUnit -q -t` ); if(`control -exists timeOpts`) optionMenuGrp -e -sl $index timeOpts; if(`control -exists timeSliderTimeOpts`) optionMenuGrp -e -sl $index timeSliderTimeOpts; } // // Set the timecode radio button // global proc prefWndUpdateTimeDisplayMenu() { $timeDisplayMode = `animDisplay -q -timeCode`; if($timeDisplayMode == "frame") radioButtonGrp -e -sl 1 timeDisplay; else if($timeDisplayMode == "fulltimecode") radioButtonGrp -e -sl 2 timeDisplay; else if($timeDisplayMode == "timecode") radioButtonGrp -e -sl 3 timeDisplay; } proc string selectionItems_melToUI(string $mel) { string $result = $mel; if ($mel == "handle"){ $result = (uiRes("m_createPrefWndUI.kHandle")); } else if ($mel == "ikHandle"){ $result = (uiRes("m_createPrefWndUI.kIKHandle")); } else if ($mel == "ikEndEffector"){ $result = (uiRes("m_createPrefWndUI.kIKEndEffector")); } else if ($mel == "joint"){ $result = (uiRes("m_createPrefWndUI.kJoint")); } else if ($mel == "light"){ $result = (uiRes("m_createPrefWndUI.kLight")); } else if ($mel == "camera"){ $result = (uiRes("m_createPrefWndUI.kCamera")); } else if ($mel == "lattice"){ $result = (uiRes("m_createPrefWndUI.kLattice")); } else if ($mel == "cluster"){ $result = (uiRes("m_createPrefWndUI.kCluster")); } else if ($mel == "sculpt"){ $result = (uiRes("m_createPrefWndUI.kSculpt")); } else if ($mel == "nonlinear"){ $result = (uiRes("m_createPrefWndUI.kNonlinear")); } else if ($mel == "nurbsCurve"){ $result = (uiRes("m_createPrefWndUI.kNurbsCurve")); } else if ($mel == "curveOnSurface"){ $result = (uiRes("m_createPrefWndUI.kCurveOnSurface")); } else if ($mel == "nurbsSurface"){ $result = (uiRes("m_createPrefWndUI.kNurbsSurface")); } else if ($mel == "polymesh"){ $result = (uiRes("m_createPrefWndUI.kPolymesh")); } else if ($mel == "plane"){ $result = (uiRes("m_createPrefWndUI.kPlane")); } else if ($mel == "particleShape"){ $result = (uiRes("m_createPrefWndUI.kParticleShape")); } else if ($mel == "emitter"){ $result = (uiRes("m_createPrefWndUI.kEmitter")); } else if ($mel == "field"){ $result = (uiRes("m_createPrefWndUI.kField")); } else if ($mel == "fluid"){ $result = (uiRes("m_createPrefWndUI.kFluid")); } else if ($mel == "spring"){ $result = (uiRes("m_createPrefWndUI.kSpring")); } else if ($mel == "rigidBody"){ $result = (uiRes("m_createPrefWndUI.kRigidBody")); } else if ($mel == "rigidConstraint"){ $result = (uiRes("m_createPrefWndUI.kRigidConstraint")); } else if ($mel == "locator"){ $result = (uiRes("m_createPrefWndUI.kLocator")); } else if ($mel == "dimension"){ $result = (uiRes("m_createPrefWndUI.kDimension")); } else if ($mel == "texture"){ $result = (uiRes("m_createPrefWndUI.kTexture")); } else if ($mel == "implicitGeometry"){ $result = (uiRes("m_createPrefWndUI.kImplicitGeometry")); } else if ($mel == "controlVertex"){ $result = (uiRes("m_createPrefWndUI.kControlVertex")); } else if ($mel == "editPoint"){ $result = (uiRes("m_createPrefWndUI.kEditPoint")); } else if ($mel == "hull"){ $result = (uiRes("m_createPrefWndUI.kHull")); } else if ($mel == "polymeshVertex"){ $result = (uiRes("m_createPrefWndUI.kPolymeshVertex")); } else if ($mel == "polymeshEdge"){ $result = (uiRes("m_createPrefWndUI.kPolymeshEdge")); } else if ($mel == "polymeshFace"){ $result = (uiRes("m_createPrefWndUI.kPolymeshFace")); } else if ($mel == "polymeshUV"){ $result = (uiRes("m_createPrefWndUI.kPolymeshUV")); } else if ($mel == "curveParameterPoint"){ $result = (uiRes("m_createPrefWndUI.kCurveParameterPoint")); } else if ($mel == "surfaceParameterPoint"){ $result = (uiRes("m_createPrefWndUI.kSurfaceParameterPoint")); } else if ($mel == "surfaceEdge"){ $result = (uiRes("m_createPrefWndUI.kSurfaceEdge")); } else if ($mel == "isoparm"){ $result = (uiRes("m_createPrefWndUI.kIsoparm")); } else if ($mel == "latticePoint"){ $result = (uiRes("m_createPrefWndUI.kLatticePoint")); } else if ($mel == "motionTrailPoint"){ $result = (uiRes("m_createPrefWndUI.kMotionTrailPoint")); } else if ($mel == "motionTrailTangent"){ $result = (uiRes("m_createPrefWndUI.kMotionTrailTangent")); } else if ($mel == "particle"){ $result = (uiRes("m_createPrefWndUI.kParticle")); } else if ($mel == "springComponent"){ $result = (uiRes("m_createPrefWndUI.kSpringComponent")); } else if ($mel == "jointPivot"){ $result = (uiRes("m_createPrefWndUI.kJointPivot")); } else if ($mel == "scalePivot"){ $result = (uiRes("m_createPrefWndUI.kScalePivot")); } else if ($mel == "rotatePivot"){ $result = (uiRes("m_createPrefWndUI.kRotatePivot")); } else if ($mel == "selectHandle"){ $result = (uiRes("m_createPrefWndUI.kSelectHandle")); } else if ($mel == "localRotationAxis"){ $result = (uiRes("m_createPrefWndUI.kLocalRotationAxis")); } else if ($mel == "imagePlane"){ $result = (uiRes("m_createPrefWndUI.kImagePlane")); } else if ($mel == "animCurve"){ $result = (uiRes("m_createPrefWndUI.kAnimCurve")); } else if ($mel == "animKeyframe"){ $result = (uiRes("m_createPrefWndUI.kAnimKeyframe")); } else if ($mel == "animBreakdown"){ $result = (uiRes("m_createPrefWndUI.kAnimBreakdown")); } else if ($mel == "animInTangent"){ $result = (uiRes("m_createPrefWndUI.kAnimInTangent")); } else if ($mel == "animOutTangent"){ $result = (uiRes("m_createPrefWndUI.kAnimOutTangent")); } else if ($mel == "subdiv"){ $result = (uiRes("m_createPrefWndUI.kSubdiv")); } else if ($mel == "subdivMeshPoint"){ $result = (uiRes("m_createPrefWndUI.kSubdivMeshPoint")); } else if ($mel == "subdivMeshEdge"){ $result = (uiRes("m_createPrefWndUI.kSubdivMeshEdge")); } else if ($mel == "subdivMeshFace"){ $result = (uiRes("m_createPrefWndUI.kSubdivMeshFace")); } else if ($mel == "surfaceFace"){ $result = (uiRes("m_createPrefWndUI.kSurfaceFace")); } else if ($mel == "hairSystem"){ $result = (uiRes("m_createPrefWndUI.kHairSystem")); } else if ($mel == "follicle"){ $result = (uiRes("m_createPrefWndUI.kFollicle")); } else if ($mel == "nCloth"){ $result = (uiRes("m_createPrefWndUI.kNCloth")); } else if ($mel == "nRigid"){ $result = (uiRes("m_createPrefWndUI.kNRigid")); } else if ($mel == "dynamicConstraint"){ $result = (uiRes("m_createPrefWndUI.kDynamicConstraint")); } else { uiToMelMsg( "selectionItems_melToUI", $mel, 1 ); } return $result; } proc string selectionItems_uiToMel(string $ui) { string $result = $ui; if($ui == uiRes("m_createPrefWndUI.kHandle")){ $result = "handle"; } else if($ui == uiRes("m_createPrefWndUI.kIKHandle")){ $result = "ikHandle"; } else if($ui == uiRes("m_createPrefWndUI.kIKEndEffector")){ $result = "ikEndEffector"; } else if($ui == uiRes("m_createPrefWndUI.kJoint")){ $result = "joint"; } else if($ui == uiRes("m_createPrefWndUI.kLight")){ $result = "light"; } else if($ui == uiRes("m_createPrefWndUI.kCamera")){ $result = "camera"; } else if($ui == uiRes("m_createPrefWndUI.kLattice")){ $result = "lattice"; } else if($ui == uiRes("m_createPrefWndUI.kCluster")){ $result = "cluster"; } else if($ui == uiRes("m_createPrefWndUI.kSculpt")){ $result = "sculpt"; } else if($ui == uiRes("m_createPrefWndUI.kNonlinear")){ $result = "nonlinear"; } else if($ui == uiRes("m_createPrefWndUI.kNurbsCurve")){ $result = "nurbsCurve"; } else if($ui == uiRes("m_createPrefWndUI.kCurveOnSurface")){ $result = "curveOnSurface"; } else if($ui == uiRes("m_createPrefWndUI.kNurbsSurface")){ $result = "nurbsSurface"; } else if($ui == uiRes("m_createPrefWndUI.kPolymesh")){ $result = "polymesh"; } else if($ui == uiRes("m_createPrefWndUI.kPlane")){ $result = "plane"; } else if($ui == uiRes("m_createPrefWndUI.kParticleShape")){ $result = "particleShape"; } else if($ui == uiRes("m_createPrefWndUI.kEmitter")){ $result = "emitter"; } else if($ui == uiRes("m_createPrefWndUI.kField")){ $result = "field"; } else if($ui == uiRes("m_createPrefWndUI.kFluid")){ $result = "fluid"; } else if($ui == uiRes("m_createPrefWndUI.kSpring")){ $result = "spring"; } else if($ui == uiRes("m_createPrefWndUI.kRigidBody")){ $result = "rigidBody"; } else if($ui == uiRes("m_createPrefWndUI.kRigidConstraint")){ $result = "rigidConstraint"; } else if($ui == uiRes("m_createPrefWndUI.kLocator")){ $result = "locator"; } else if($ui == uiRes("m_createPrefWndUI.kDimension")){ $result = "dimension"; } else if($ui == uiRes("m_createPrefWndUI.kTexture")){ $result = "texture"; } else if($ui == uiRes("m_createPrefWndUI.kImplicitGeometry")){ $result = "implicitGeometry"; } else if($ui == uiRes("m_createPrefWndUI.kControlVertex")){ $result = "controlVertex"; } else if($ui == uiRes("m_createPrefWndUI.kEditPoint")){ $result = "editPoint"; } else if($ui == uiRes("m_createPrefWndUI.kHull")){ $result = "hull"; } else if($ui == uiRes("m_createPrefWndUI.kPolymeshVertex")){ $result = "polymeshVertex"; } else if($ui == uiRes("m_createPrefWndUI.kPolymeshEdge")){ $result = "polymeshEdge"; } else if($ui == uiRes("m_createPrefWndUI.kPolymeshFace")){ $result = "polymeshFace"; } else if($ui == uiRes("m_createPrefWndUI.kPolymeshUV")){ $result = "polymeshUV"; } else if($ui == uiRes("m_createPrefWndUI.kCurveParameterPoint")){ $result = "curveParameterPoint"; } else if($ui == uiRes("m_createPrefWndUI.kSurfaceParameterPoint")){ $result = "surfaceParameterPoint"; } else if($ui == uiRes("m_createPrefWndUI.kSurfaceEdge")){ $result = "surfaceEdge"; } else if($ui == uiRes("m_createPrefWndUI.kIsoparm")){ $result = "isoparm"; } else if($ui == uiRes("m_createPrefWndUI.kLatticePoint")){ $result = "latticePoint"; } else if($ui == uiRes("m_createPrefWndUI.kMotionTrailPoint")){ $result = "motionTrailPoint"; } else if($ui == uiRes("m_createPrefWndUI.kMotionTrailTangent")){ $result = "motionTrailTangent"; } else if($ui == uiRes("m_createPrefWndUI.kParticle")){ $result = "particle"; } else if($ui == uiRes("m_createPrefWndUI.kSpringComponent")){ $result = "springComponent"; } else if($ui == uiRes("m_createPrefWndUI.kJointPivot")){ $result = "jointPivot"; } else if($ui == uiRes("m_createPrefWndUI.kScalePivot")){ $result = "scalePivot"; } else if($ui == uiRes("m_createPrefWndUI.kRotatePivot")){ $result = "rotatePivot"; } else if($ui == uiRes("m_createPrefWndUI.kSelectHandle")){ $result = "selectHandle"; } else if($ui == uiRes("m_createPrefWndUI.kLocalRotationAxis")){ $result = "localRotationAxis"; } else if($ui == uiRes("m_createPrefWndUI.kImagePlane")){ $result = "imagePlane"; } else if($ui == uiRes("m_createPrefWndUI.kAnimCurve")){ $result = "animCurve"; } else if($ui == uiRes("m_createPrefWndUI.kAnimKeyframe")){ $result = "animKeyframe"; } else if($ui == uiRes("m_createPrefWndUI.kAnimBreakdown")){ $result = "animBreakdown"; } else if($ui == uiRes("m_createPrefWndUI.kAnimInTangent")){ $result = "animInTangent"; } else if($ui == uiRes("m_createPrefWndUI.kAnimOutTangent")){ $result = "animOutTangent"; } else if($ui == uiRes("m_createPrefWndUI.kSubdiv")){ $result = "subdiv"; } else if($ui == uiRes("m_createPrefWndUI.kSubdivMeshPoint")){ $result = "subdivMeshPoint"; } else if($ui == uiRes("m_createPrefWndUI.kSubdivMeshEdge")){ $result = "subdivMeshEdge"; } else if($ui == uiRes("m_createPrefWndUI.kSubdivMeshFace")){ $result = "subdivMeshFace"; } else if($ui == uiRes("m_createPrefWndUI.kSurfaceFace")){ $result = "surfaceFace"; } else if($ui == uiRes("m_createPrefWndUI.kHairSystem")){ $result = "hairSystem"; } else if($ui == uiRes("m_createPrefWndUI.kFollicle")){ $result = "follicle"; } else if($ui == uiRes("m_createPrefWndUI.kNCloth")){ $result = "nCloth"; } else if($ui == uiRes("m_createPrefWndUI.kNRigid")){ $result = "nRigid"; } else if($ui == uiRes("m_createPrefWndUI.kDynamicConstraint")){ $result = "dynamicConstraint"; } else{ uiToMelMsg( "selectionItems_uiToMel", $ui, 1 ); } return $result; } global proc prefSelChildHighlightModeChanged() { // optionMenuGrp uses a 1-based index, while selectPref -sch uses // a 0-based index. int $val = `optionMenuGrp -q -sl prefSelChildHighlightMode` - 1; selectPref -sch $val; } global proc prefSelectPriorListChanged() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $selected[] = `textScrollList -q -si priorList`; int $val = eval("selectPriority -q -"+ `selectionItems_uiToMel $selected[0]` ); intFieldGrp -e -v1 $val priorVal; } global proc prefSelectPriorValChanged() { global string $gSelItems[]; global int $gCustomSelPriority[]; global string $gPreferenceWindow; setParent $gPreferenceWindow; string $selected[] = `textScrollList -q -si priorList`; int $selIndex[] = `textScrollList -q -sii priorList`; string $type; int $val; int $i = 0; // Update each selected priority. // for ($type in $selected) { $val = `intFieldGrp -q -v1 priorVal`; eval("selectPriority -"+ `selectionItems_uiToMel $selected[$i]` +" "+$val); // If we're saving custom priorities, then record the change // if ((uiRes("m_createPrefWndUI.kCustom")) == `optionMenuGrp -q -v presetOpts`) { // Because the elements of $gCustomSelPriority correspond to the // ordering used in $gSelItems and _not_ alphabetical ordering, then // we must find the proper non-alphabetical index to set the value. // int $optionVarIndex; for($optionVarIndex = 0; $optionVarIndex < size($gSelItems); $optionVarIndex++) { if($gSelItems[$optionVarIndex] == `selectionItems_uiToMel $type`) { $gCustomSelPriority[$optionVarIndex] = $val; break; } } } $i++; } } global proc prefSelectPriorModeChanged() { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $priorityPreset = `optionMenuGrp -q -sl presetOpts`; switch ($priorityPreset) { case 1: // Custom selPriority "custom"; intFieldGrp -e -en true priorVal; break; case 2: // Anim selPriority "animation"; intFieldGrp -e -en false priorVal; break; case 3: // NURBS selPriority "nurbs"; intFieldGrp -e -en false priorVal; break; case 4: // Render selPriority "rendering"; intFieldGrp -e -en false priorVal; break; case 5: // Dynamics selPriority "dynamics"; intFieldGrp -e -en false priorVal; break; } string $selected[] = `textScrollList -q -si priorList`; int $val = eval("selectPriority -q -"+ `selectionItems_uiToMel $selected[0]` ); intFieldGrp -e -v1 $val priorVal; } global proc prefsChangeOutputType(int $mode) { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $goAhead = (uiRes("m_createPrefWndUI.kGoAhead")); int $curType = `modelWithType (-1)`; // If the current type is 'mixed' then warning the user string $ok = (uiRes("m_createPrefWndUI.kOK")); string $cancel = (uiRes("m_createPrefWndUI.kCancel")); if ($curType == -1) { string $theMessage = (uiRes("m_createPrefWndUI.kChangeGeometryMsg")); $goAhead = `confirmDialog -title (uiRes("m_createPrefWndUI.kInformationTitle")) -messageAlign "left" -message $theMessage -button $ok -button $cancel -defaultButton $cancel -cancelButton $cancel -parent $gPreferenceWindow`; } if ($goAhead == $ok) { modelWithType($mode); radioButtonGrp -e -enable 0 modelWithType5; } else { // Reset the 'mixed' button radioButtonGrp -e -sl 1 -enable 1 modelWithType5; } } global proc printDpiSettingChangeWarning () { string $msg = (uiRes("m_createPrefWndUI.kDpiSettingChangeWarning")); warning $msg; } global proc prefWndIntScaleChanged () { // Interface scaling value from menu will be string in the form "125%" // Need to convert to int. string $scaleValue = `optionMenuGrp -q -value customScaleOpt`; // Remove % off the end first $scaleValue = `substitute "\%" $scaleValue ""`; // Convert to int and then float float $scale = ((int) $scaleValue)/100.0; optionVar -fv interfaceScalingValue $scale; // Also print a warning for restarting Maya. printDpiSettingChangeWarning(); } global proc defaultVertexNormalMethodChanged_CB () { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $i = `optionMenuGrp -q -sl polyDefaultVertexNormalMethod_OMG`; if ($i < 1 || $i > 4) $i = 4; polyOptions -newPolymesh -vertexNormalMethod ($i - 1); } global proc defaultSmoothDrawTypeChanged_CB () { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $i = `optionMenuGrp -q -sl polyDefaultSmoothDrawType_OMG`; if ($i < 1 || $i > 4) $i = 1; int $drawType = ($i -1); polyOptions -newPolymesh -smoothDrawType $drawType; } global proc globalSmoothDrawTypeChanged_CB () { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $i = `optionMenuGrp -q -sl polyGlobalSmoothDrawType_OMG`; if ($i < 1 || $i > 4) $i = 1; int $drawType = ($i -1); polyOptions -smoothDrawType $drawType; } global proc prefsChangeToolType(int $mode) { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $ok = (uiRes("m_createPrefWndUI.kOKOption")) ; string $cancel = (uiRes("m_createPrefWndUI.kCancelOption")); string $goAhead = $ok; int $curType = `modelWithToolsAll (-1)`; // If the current type is 'mixed' then warning the user if ($curType == -1) { string $theMessage = (uiRes("m_createPrefWndUI.kChangeOutputMsg")); $goAhead = `confirmDialog -title (uiRes("m_createPrefWndUI.kInformationWnd")) -messageAlign "left" -message $theMessage -button $ok -button $cancel -defaultButton $cancel -cancelButton $cancel -parent $gPreferenceWindow`; } if ($goAhead == $ok) { modelWithToolsAll($mode); radioButtonGrp -e -enable 0 modelWithTools3; } else { // Reset the 'mixed' button radioButtonGrp -e -sl 1 -enable 1 modelWithTools3; } } global proc prefsChangeNodeNameScheme(int $mode) { modelNodeNameScheme($mode); } global proc prefPolyChangeMaterial () { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $i = `optionMenuGrp -q -sl colorMaterialPopup`; if ($i==1) polyOptions -np -cm "none"; else if ($i==2) polyOptions -np -cm "ambient"; else if ($i==3) polyOptions -np -cm "ambientDiffuse"; else if ($i==4) polyOptions -np -cm "diffuse"; else if ($i==5) polyOptions -np -cm "specular"; else if ($i==6) polyOptions -np -cm "emission"; } global proc prefPolyMaterialBlend () { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $i = `optionMenuGrp -q -sl materialBlendPopup`; if ($i==1) polyOptions -np -mb "overwrite"; else if ($i==2) polyOptions -np -mb "add"; else if ($i==3) polyOptions -np -mb "subtract"; else if ($i==4) polyOptions -np -mb "multiply"; else if ($i==5) polyOptions -np -mb "divide"; else if ($i==6) polyOptions -np -mb "average"; else if ($i==7) polyOptions -np -mb "modulate2x"; } global proc prefPolyUpdateCulling () { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $backfaceCulling = `optionMenuGrp -q -select polyFBackCullPopup`; checkBoxGrp -edit -enable3 ($backfaceCulling != 1) polyVertDispCheck; } global proc prefPolyChangeCulling () { global string $gPreferenceWindow; setParent $gPreferenceWindow; int $val = `optionMenuGrp -q -sl polyFBackCullPopup`; if ($val == 1) { polyOptions -np -bc; } else if ($val == 2) { polyOptions -np -fb; } else if ($val == 3) { polyOptions -np -wbc; } else if ($val == 4) { polyOptions -np -hb; } prefPolyUpdateCulling; } global proc prefAnimTangentsChanged( int $inTangent ) { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $widget = $inTangent == 1 ? "inTangentType" : "outTangentType"; string $flag = $inTangent == 1 ? "-itt" : "-ott"; string $type = "spline"; int $value = `optionMenuGrp -q -select $widget`; // This function returns the type string for the tangent we // have selected. The outTangent list has an extra item // 'step' at position 5. So for case 5 and 6 we have to // know if we are looking for the in/out tangent to decide // which type to return. See if tests below. switch( $value ) { case 1: $type = "spline"; break; case 2: $type = "linear"; break; case 3: $type = "clamped"; break; case 4: $type = "flat"; break; case 5: if ($inTangent == 1) { $type = "plateau"; } else { $type = "step"; } break; case 6: if ($inTangent == 1) { $type = "auto"; } else { $type = "plateau"; } break; case 7: $type = "auto"; break; default: break; } evalEcho( "keyTangent -global " + $flag + " " + $type ); } global proc prefAutoKeyCharacterChanged() { int $value = `optionMenuGrp -q -select autoKeyCharacter`; string $type = "standard"; switch( $value ) { case 1: $type = "standard"; break; case 2: $type = "all"; break; break; } evalEcho( "autoKeyframe -characterOption "+$type ); } global proc prefWndHelpLanguageChanged() { global string $gHelpLanguage; string $origHelpLanguage = $gHelpLanguage; global string $gAvailableLanguages[]; $gHelpLanguage = "en_US"; string $selectedLanguage = `optionMenu -q -v helpLanguagePopup`; for ($language in $gAvailableLanguages) { string $a[]; tokenize $language ":" $a; if($selectedLanguage == $a[1]) { $gHelpLanguage = $a[0]; break; } } optionVar -sv helpLanguage $gHelpLanguage; // We display the "Help language doesn't match UI // language" confirm box only the first time a user asks // for help in a language different from the UI // language. If the user changes the language setting // here such that the language mismatch happens again, // remove the optionVar so the confirm box displays -- // but, again, only the first time after the language // switch. (No need to protect with an existence check; // optionVar doesn't care if you remove a non-existing // optionVar.) // if( $origHelpLanguage != $gHelpLanguage ) { optionVar -remove helpLanguageMismatchConfirm; } } global proc prefWndHelpLocationModeUpdate() { int $isCustom = `radioButton -q -sl customPathBtn`; optionMenu -e -enable (!$isCustom) helpLanguagePopup; textField -e -enable ($isCustom) helpDirectoryField; symbolButton -e -enable ($isCustom) browseBtn; if($isCustom){ optionVar -sv helpMode "Custom"; }else{ optionVar -sv helpMode "Autodesk Web Site"; } } global proc prefWndHelpLocationValueUpdate() { global string $gMayaVersionYear; optionVar -sv ("customPathHelpUrl" + $gMayaVersionYear) `textField -q -text helpDirectoryField`; } global proc int prefWndHelpLocationBrowserCallBack(string $dirName, string $fileType) { textField -e -fileName $dirName helpDirectoryField; prefWndHelpLocationValueUpdate(); return true; } global proc prefWndHelpLocationBrowser() { string $cmd = "prefWndHelpLocationBrowserCallBack"; string $open = (uiRes("m_createPrefWndUI.kOpen")); fileBrowser ($cmd, $open, "", 4); } global proc prefWndViewCubePositionChanged() { string $topRight = uiRes("m_createPrefWndUI.kViewCubeTopRight"); string $bottomRight = uiRes("m_createPrefWndUI.kViewCubeBottomRight"); string $topLeft = uiRes("m_createPrefWndUI.kViewCubeTopLeft"); string $bottomLeft = uiRes("m_createPrefWndUI.kViewCubeBottomLeft"); string $position = `optionMenuGrp -q -value ViewCubeScreenPosMenu`; if ($position == $topRight) { viewManip -topRight; } else if ($position == $bottomRight) { viewManip -bottomRight; } else if ($position == $topLeft) { viewManip -topLeft; } else if ($position == $bottomLeft) { viewManip -bottomLeft; } } global proc prefWndViewCubeSizeChanged() { string $small = uiRes("m_createPrefWndUI.kViewCubeSmall"); string $normal = uiRes("m_createPrefWndUI.kViewCubeNormal"); string $large = uiRes("m_createPrefWndUI.kViewCubeLarge"); string $screenSize = `optionMenuGrp -q -value ViewCubeSizeMenu`; if ($screenSize == $small) { viewManip -size "small"; } else if ($screenSize == $normal) { viewManip -size "normal"; } else if ($screenSize == $large) { viewManip -size "large"; } } global proc prefWndViewOpacityChanged() { // Opacity value from menu will be string in the form "25%" // Need to convert to float in form 0.25 string $opacityValue = `optionMenuGrp -q -value ViewCubeOpacityMenu`; // Remove % off the end first $opacityValue = `substitute "\%" $opacityValue ""`; // Convert to float float $opacity = (float) $opacityValue; $opacity = $opacity / 100; viewManip -minOpacity $opacity; } global proc prefInteractionModeChanged() { global string $gSuitesInteractionMode; global string $gSuitesInteractionModeChange; if(`suitePrefs -q -installedAsSuite` && `optionMenu -exists SuitesApplyInteractionModeToOptionMenu`) { string $newInteractionMode = ""; if(`optionMenu -exists SuitesSelectInteractionModeOptionMenu`) { if(`optionMenu -q -select SuitesSelectInteractionModeOptionMenu` == 1) { if(`optionMenu -q -select SuitesApplyInteractionModeToOptionMenu` == 1) { $newInteractionMode = "Maya"; } else { $newInteractionMode = "undefined"; } } else { $newInteractionMode = "3dsMax"; } } else if(`text -exists SuitesSelectInteractionModeOptionLabel`) { if(`optionMenu -q -select SuitesApplyInteractionModeToOptionMenu` == 1) { $newInteractionMode = "Maya"; } else { $newInteractionMode = "undefined"; } } if($newInteractionMode != "" && $gSuitesInteractionMode != $newInteractionMode) { $gSuitesInteractionModeChange = $newInteractionMode; } else { $gSuitesInteractionModeChange = "none"; } } } global proc saveInteractionModePrefChanges() { global string $gSuitesInteractionMode; global string $gSuitesInteractionModeChange; if(!`suitePrefs -q -installedAsSuite`) { return; } if($gSuitesInteractionModeChange != "none" && $gSuitesInteractionModeChange != $gSuitesInteractionMode) { string $title = (uiRes("m_createPrefWndUI.kInteractionModeSettings")); string $ok = (uiRes("m_createPrefWndUI.kOKText")); string $cancel = (uiRes("m_createPrefWndUI.kCancelText")); string $message = ""; if($gSuitesInteractionModeChange == "Maya" || $gSuitesInteractionModeChange == "3dsMax") { $message = (uiRes("m_createPrefWndUI.kApplyToSuiteWarning")); } else { $message = (uiRes("m_createPrefWndUI.kForMayaOnlyWarning")); } string $confirm = `confirmDialog -title $title -message $message -button $ok -button $cancel -defaultButton $ok -cancelButton $cancel -dismissString $cancel`; if($confirm == $ok) { suitePrefs -applyToSuite $gSuitesInteractionModeChange; $gSuitesInteractionMode = $gSuitesInteractionModeChange; } } $gSuitesInteractionModeChange = "none"; } //---------------------------------------------------------------- // // Begin section of creation procedures // //---------------------------------------------------------------- global proc prefsCreateAppearance() { global string $gPreferenceWindow; global string $gMainWindow; global string $gCommandWindow; setParent $gPreferenceWindow; string $parent = "prefAppearCol"; // Check to see if this has been created already. if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kInterfaceOption")) ; columnLayout -adj true; global string $gModeOptionsMenu; $gModeOptionsMenu = `optionMenuGrp -label (uiRes("m_createPrefWndUI.kMenuSet")) -cc "prefApplyWorkingMode" modeOpts`; string $curMode = `setMenuMode`; if (size($curMode) > 0) { workingMode($curMode); } // select the mode in the drop down updateDropDownMenu($gModeOptionsMenu, true); string $showMenubar = (uiRes("m_createPrefWndUI.kShowMenubar")); string $inMainWindow = (uiRes("m_createPrefWndUI.kInMainWindow")); string $inPanels = (uiRes("m_createPrefWndUI.kInPanels")); string $showTitleBar = (uiRes("m_createPrefWndUI.kShowTitleBar")); string $showPanelBar = (uiRes("m_createPrefWndUI.kShowIconBar")); string $inScriptEditor = (uiRes("m_createPrefWndUI.kInScriptEditor")); if (`about -mac`) { // Fix for Bug #156604 // On the Mac - We do-not provide an option to show/hide Main Menubar // as this is a *really *nasty thing to do*. It is really only // intended for games and such which want to go into fullscreen mode // checkBoxGrp -ncb 1 -cw 2 220 -label $showMenubar -h 2 -visible false -label1 $inMainWindow -cc "window -e -mbv #1 $gMainWindow" mainMenubarCheck1; checkBoxGrp -ncb 1 -label $showMenubar -cw 2 100 -label1 $inPanels -cc "toggleMenuBarsInPanels #1" showMenuBarChk; checkBoxGrp -ncb 1 -cw 2 220 -label $showPanelBar -changeCommand "ToggleModelEditorBars" panelToolbarCheck1; // We do not support showing/hiding of the Title Bar // If you hide the title bar, the user has no way to 'move' the window. // checkBoxGrp -ncb 1 -cw 2 220 -label $showTitleBar -label1 $inMainWindow -h 1 -visible false -cc "window -e -titleBar #1 $gMainWindow" mainTitleCheck1; checkBoxGrp -ncb 1 -cw 2 220 -label " " -label1 $inScriptEditor -h 1 -visible false -cc "if (`scriptedPanel -q -tearOff scriptEditorPanel1`) { window -e -titleBar #1 scriptEditorPanel1Window; }" cmdTitleCheck1; } else { checkBoxGrp -ncb 1 -cw 2 220 -label $showMenubar -label1 $inMainWindow -cc "window -e -mbv #1 $gMainWindow" mainMenubarCheck1; checkBoxGrp -ncb 1 -label " " -cw 2 100 -label1 $inPanels -cc "toggleMenuBarsInPanels #1" showMenuBarChk; checkBoxGrp -ncb 1 -cw 2 220 -label $showPanelBar -changeCommand "ToggleModelEditorBars" panelToolbarCheck1; checkBoxGrp -ncb 1 -cw 2 220 -label $showTitleBar -label1 $inMainWindow -cc "window -e -titleBar #1 $gMainWindow" mainTitleCheck1; checkBoxGrp -ncb 1 -cw 2 220 -label " " -label1 $inScriptEditor -cc "if (`scriptedPanel -q -tearOff scriptEditorPanel1`) { window -e -titleBar #1 scriptEditorPanel1Window; }" cmdTitleCheck1; } checkBoxGrp -ncb 1 -cw 2 200 -label (uiRes("m_createPrefWndUI.kWindows")) -label1 (uiRes("m_createPrefWndUI.kRememberSizeAndPosition")) -cc1 "windowPref -enableAll #1" winPrefChk; checkBoxGrp -ncb 1 -cw 2 200 -label (uiRes("m_createPrefWndUI.kShowIconsInMenus")) -changeCommand "optionVar -iv showIconsInMenus #1" iconsInMenusCheck; string $prefLabelFormat = (uiRes("m_createPrefWndUI.kCommandLineLabel")); checkBoxGrp -ncb 1 -label `format -s (localizedUIComponentLabel("Command Line")) $prefLabelFormat` -label1 (uiRes("m_createPrefWndUI.kHoldFocus")) -changeCommand "optionVar -iv commandLineHoldFocus #1; commandLine -e -holdFocus #1 $gCommandLine" focusCheck; optionMenuGrp -label (uiRes("m_createPrefWndUI.kExpressionEditorOptions")) -cc "prefExprEdTextEditor 0" textEdOpts; string $otherEditor = (uiRes("m_createPrefWndUI.kOtherEditor")); menuItem -label (uiRes("m_createPrefWndUI.kExpressionEditor")) ; if (`about -mac`) { menuItem -label (uiRes("m_createPrefWndUI.kTextEdit")) ; } else if (`about -nt`) { menuItem -label (uiRes("m_createPrefWndUI.kTextEditor")) ; } else if (`about -linux`) { menuItem -label "emacs"; menuItem -label "gvim"; menuItem -label "vi"; menuItem -label "vim"; menuItem -label "xedit"; menuItem -label "xemacs"; menuItem -label $otherEditor; } setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kHighlightWhatsNew")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -cw 2 220 -label " " -label1 (uiRes("m_createPrefWndUI.kToggleHighlight")) -cc1 "if(#1) { WhatsNewHighlightingOn; } else { WhatsNewHighlightingOff; }" highlightWhatsNewChk; checkBoxGrp -ncb 1 -cw 2 220 -label (uiRes("m_createPrefWndUI.kShowHighlightStartupDialog")) -label1 (uiRes("m_createPrefWndUI.kToggleHighlightStartupDialog")) -cc "if(#1) { WhatsNewStartupDialogOn; } else { WhatsNewStartupDialogOff; }" whatsNewStartupDialogChk; colorSliderGrp -cw 2 80 -label (uiRes("m_createPrefWndUI.kHighlightColor")) -cc "float $color[] = `colorSliderGrp -q -rgb whatsNewHighlightColorSlider`; whatsNewHighlight -highlightColor $color[0] $color[1] $color[2];" whatsNewHighlightColorSlider; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kDevices")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -cw 2 200 -label (uiRes("m_createPrefWndUI.kMouseScrollWheel")) -label1 (uiRes("m_createPrefWndUI.kEnable")) -cc1 "mouse -enableScrollWheel #1" wheelPrefChk; string $twoButton = (uiRes("m_createPrefWndUI.kTwoButton")); string $threeButton = (uiRes("m_createPrefWndUI.kThreeButton")); if (`about -mac`) { radioButtonGrp -nrb 3 -label (uiRes("m_createPrefWndUI.kMouseTracking")) -cw 2 100 -cw 3 100 -labelArray3 (uiRes("m_createPrefWndUI.kOneButton")) $twoButton $threeButton -on1 "mouse -mouseButtonTracking 1" -on2 "mouse -mouseButtonTracking 2" -on3 "mouse -mouseButtonTracking 3" mouseTracking; } checkBoxGrp -ncb 1 -cw 2 220 -label (uiRes("m_createPrefWndUI.kMultiTouchGestures")) -label1 (uiRes("m_createPrefWndUI.kEnable1")) -changeCommand "optionVar -iv useMultiTouchGestures #1; multiTouch -gestures #1" multiTouchGesturesChk; if (`about -mac`) { optionMenuGrp -label (uiRes("m_createPrefWndUI.kUseTrackpad")) -cc "prefMultiTouchUseTrackpad" multiTouchTrackpadOpt; menuItem -label (uiRes("m_createPrefWndUI.kCursorNav")); menuItem -label (uiRes("m_createPrefWndUI.kMultiTouchNav")); menuItem -label (uiRes("m_createPrefWndUI.kCursorAndMultiTouchNav")); } setParent $parent; // DPI Scaling separator; frameLayout -label (uiRes("m_createPrefWndUI.kIntScale")) ; columnLayout -adj true; columnLayout -adj true -cat "left" 35 -cal "left"; text -align "left" -l (uiRes("m_createPrefWndUI.kIntScaleMessage")); setParent ".."; int $dpi = `mayaDpiSetting -q -systemDpi`; radioButtonGrp -numberOfRadioButtons 2 -vr -label "" -label1 ((uiRes("m_createPrefWndUI.kUseSystemScale")) + "[" + string($dpi) + " ppi]") -label2 (uiRes("m_createPrefWndUI.kUseCustomScale")) -on1 "optionMenuGrp -e -enable false customScaleOpt; optionVar -iv interfaceScalingMode 0; printDpiSettingChangeWarning;" -on2 "optionMenuGrp -e -enable true customScaleOpt; optionVar -iv interfaceScalingMode 1; printDpiSettingChangeWarning;" dpiSettingOpt; optionMenuGrp -label "" -changeCommand ("prefWndIntScaleChanged") customScaleOpt; menuItem -label "100%"; menuItem -label "125%"; menuItem -label "150%"; menuItem -label "200%"; radioButtonGrp -numberOfRadioButtons 1 -vr -label "" -label1 (uiRes("m_createPrefWndUI.kNoDpiScaling")) -on1 "optionMenuGrp -e -enable false customScaleOpt; optionVar -iv interfaceScalingMode 2; printDpiSettingChangeWarning;" -scl dpiSettingOpt dpiSettingOpt2; setParent $parent; setUITemplate -popTemplate; prefsUpdateAppearance(); } global proc prefsCreateElements() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefElementsCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { prefsUpdateElements(); return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kVisibleUIElements")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Status Line")) -changeCommand "setStatusLineVisible #1" statusLineCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Shelf")) -changeCommand "setShelfVisible #1" shelfCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Time Slider")) -changeCommand "setTimeSliderVisible #1" timeSliderCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Range Slider")) -changeCommand "setPlaybackRangeVisible #1" playbackRangeCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Command Line")) -changeCommand "setCommandLineVisible #1" commandLineCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Help Line")) -changeCommand "setHelpLineVisible #1" helpLineCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Tool Box")) -changeCommand "setToolboxVisible #1" toolboxCheckBox; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kEditorInMainWindow")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kShowEditor")) -changeCommand "setShowEditorInMainWindow #1" editorCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Attribute Editor")) -changeCommand "setAttributeEditorVisible #1" attributeEditorCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Tool Settings")) -changeCommand "setToolSettingsVisible #1" toolSettingsCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Channel Box")) -changeCommand "setChannelsVisible #1" channelsCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Layer Editor")) -changeCommand "setLayersVisible #1" layersCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (localizedUIComponentLabel("Channel Box / Layer Editor")) -changeCommand "setChannelsLayersVisible #1" channelsLayersCheckBox; separator; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kWrapIcons")) -onCommand "channelsLayersPrefChange false; prefsUpdateElementsEditors;" -offCommand "channelsLayersPrefChange true; prefsUpdateElementsEditors;" channelsLayersSeparatePrefChk; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kPanelConfigurations")) sConfig; columnLayout -adj true sfConfig; checkBoxGrp -ncb 1 -label (uiRes("m_createPrefWndUI.kWhenSaving")) -label1 (uiRes("m_createPrefWndUI.kSavePanelLayoutsWithFile")) -on1 "$gUseSaveScenePanelConfig = true; file -uc true;" -of1 "$gUseSaveScenePanelConfig = false;file -uc false;" -cw 2 250 saveConfig; checkBoxGrp -ncb 1 -label (uiRes("m_createPrefWndUI.kWhenOpening")) -label1 (uiRes("m_createPrefWndUI.kRestoreSavedLayouts")) -on1 "$gUseScenePanelConfig = true; file -uc true;" -of1 "$gUseScenePanelConfig = false;file -uc false;" -cw 2 250 openConfig; radioButtonGrp -nrb 1 -label (uiRes("m_createPrefWndUI.kStartingNewScenes")) -label1 (uiRes("m_createPrefWndUI.kKeepCurrentLayout")) -on1 "$gUseNewScenePanelConfig = false;" -cw 2 250 newConfig1; radioButtonGrp -nrb 1 -label "" -scl newConfig1 -label1 (uiRes("m_createPrefWndUI.kUseSpecifiedLayout")) -on1 "$gUseNewScenePanelConfig = true;" -cw 2 250 newConfig2; optionMenuGrp -label "" -cc "$gNewScenePanelConfig = \"#1\"" configOpts; checkBoxGrp -ncb 1 -label (uiRes("m_createPrefWndUI.kOnNewScene")) -label1 (uiRes("m_createPrefWndUI.kResetModelViewSettings")) -on1 "optionVar -intValue ResetModelViewsOnNewScene 1;" -of1 "optionVar -intValue ResetModelViewsOnNewScene 0;" -cw 2 250 ResetModelViewsOnNewScene; setParent $parent; setUITemplate -popTemplate; prefsUpdateElements(); } global proc int disablePrefsUILanguageForEnv() { int $toDisable = 0; // If MAYA_UI_LANGUAGE is set, disable the pref setting. string $envLanguage = `getenv MAYA_UI_LANGUAGE`; if(size($envLanguage) == 0) { $toDisable = 0; } else { $toDisable = 1; } return $toDisable; } global proc int enableLanguageItem(string $locale) { // For platforms that is not Windows, all language items are valid, // so we simply return true. if (!`about -windows`) { return 1; } // Only on Windows we can encounter invalid language item. // For example, when locale is Chinese, option Japanese is invalid // and should be greyed out. Invalid means that codec mismatch // current locale and could cause garabled UI. // English is valid for any locale. if($locale == "en_US") { return 1; } // If locale does not match with system locale, it is invalid. string $currentLocaleLang = `about -uiLocaleLanguage`; if($locale != $currentLocaleLang) { return 0; } return 1; } global proc string internationalizedLanguageLabel(string $locale) { string $languageLable; if($locale == "zh_CN") { $languageLable = (uiRes("m_createPrefWndUI.kChineseLanguage")); } else if($locale == "ja_JP") { $languageLable = (uiRes("m_createPrefWndUI.kJapaneseLanguage")); } else if($locale == "en_US") { $languageLable = (uiRes("m_createPrefWndUI.kEnglishLanguage")); } return $languageLable; } global proc prefsSwitchUILanguageMode() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefLanguageCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kLanguageSetting")) ; formLayout languageSettingLayout; // Create the information text. string $setLanguageInfoText; int $toDisableForEnv = disablePrefsUILanguageForEnv(); if($toDisableForEnv) { $setLanguageInfoText = `text -align "center" -l (uiRes("m_createPrefWndUI.kDisableLanguageSettingInfo"))`; } else { $setLanguageInfoText = `text -align "center" -l (uiRes("m_createPrefWndUI.kLanguageSettingInfo"))`; } string $languageLabel = `text -w 90 -label (uiRes("m_createPrefWndUI.kLanguage")) -align "center"`; // Create the language droplist string $uiLanguageMenu = `optionMenu -w 220 -changeCommand "prefUILanguageChanged" UILanguageOptionMenu`; // Add language items to the droplist and grey out the ones that should not be selected by user. string $languageResources[] = `about -languageResources`; for ($languageResource in $languageResources) { string $elements[]; tokenize $languageResource ":" $elements; string $locale = $elements[0]; int $enableItem = enableLanguageItem($locale); string $languageLable = internationalizedLanguageLabel($locale); menuItem -enable $enableItem -label $languageLable $uiLanguageMenu; } // Make current startup language as current selection int $numLanguages = size($languageResources); string $startupLang = `about -uiLanguageForStartup`; int $i; for ($i = 0; $i < $numLanguages; $i++) { string $elements[]; tokenize $languageResources[$i] ":" $elements; string $locale = $elements[0]; if($locale == $startupLang) optionMenu -e -sl ($i+1) $uiLanguageMenu; } // Environment variable MAYA_UI_LANGUAGE has higher priority than this option. // So disable the option if MAYA_UI_LANGUAGE is set. if ($toDisableForEnv) { optionMenu -e -en 0 $uiLanguageMenu; } else { optionMenu -e -en 1 $uiLanguageMenu; } // Layout all above UI controls. formLayout -edit -attachForm $setLanguageInfoText "top" 10 -attachForm $setLanguageInfoText "left" 40 -attachControl $languageLabel "top" 8 $setLanguageInfoText -attachForm $languageLabel "left" 23 -attachControl $uiLanguageMenu "top" 8 $setLanguageInfoText -attachControl $uiLanguageMenu "left" 10 $languageLabel -attachForm $uiLanguageMenu "bottom" 10 languageSettingLayout; setParent $parent; setUITemplate -popTemplate; } global proc prefUILanguageChanged() { string $languageResources[] = `about -languageResources`; if(`optionMenu -exists UILanguageOptionMenu`) { int $selected = `optionMenu -q -select UILanguageOptionMenu`; string $elements[]; tokenize $languageResources[$selected-1] ":" $elements; uiLanguage -uil $elements[0]; } } global proc prefsCreateWindows() { global string $gPreferenceWindow; global string $gHelpLanguage; global string $gNewScenePanelConfig; global string $gMayaVersionYear; global int $gUseNewScenePanelConfig; global int $gUseScenePanelConfig; global int $gUseSaveScenePanelConfig; global string $gAvailableLanguages[]; setParent $gPreferenceWindow; string $parent = "prefWindowsCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kInViewPreferences")) ; columnLayout -adj true; checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kInViewMessageEnable")) -changeCommand ("optionVar -iv inViewMessageEnable #1;" + "control -edit -enable #1 prefsInViewMessageAssistEnable;" + "control -edit -enable #1 prefsInViewMessageStatusEnable;" + "control -edit -enable #1 prefsInViewMessageDisplayTime;" + "control -edit -enable #1 prefsInViewMessageFontSize;" + "control -edit -enable #1 prefsInViewMessageOpacity;") prefsInViewMessageEnable; checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kInViewMessageAssistEnable")) -changeCommand "optionVar -iv inViewMessageAssistEnable #1" prefsInViewMessageAssistEnable; checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kInViewMessageStatusEnable")) -changeCommand "optionVar -iv inViewMessageStatusEnable #1" prefsInViewMessageStatusEnable; rowLayout -nc 3 -cw3 140 80 150 -cat 1 "both" 0 -cal 1 "right" -cat 3 "both" 0 -cal 3 "left" displayTimeRow; text -label (uiRes("m_createPrefWndUI.kInViewMessageDisplayTime")); floatField -width 80 -value `optionVar -query inViewMessageDisplayTime` -minValue 1.0 -precision 1 -changeCommand "optionVar -fv inViewMessageDisplayTime #1" prefsInViewMessageDisplayTime; text -label (uiRes("m_createPrefWndUI.kInViewMessageDisplayTimeM")); setParent ..; intSliderGrp -label (uiRes("m_createPrefWndUI.kInViewMessageFontSize")) -field 12 -min 6 -max 32 -changeCommand "optionVar -iv inViewMessageFontSize #1" prefsInViewMessageFontSize; intSliderGrp -label (uiRes("m_createPrefWndUI.kInViewMessageOpacity")) -field 75 -min 0 -max 100 -changeCommand "optionVar -iv inViewMessageOpacity #1" prefsInViewMessageOpacity; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kPopupHelp")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label (uiRes("m_createPrefWndUI.kToolClips")) -changeCommand "help -popupMode #1; control -e -en #1 popupSimpleHelpMode" popupHelpMode; checkBoxGrp -ncb 1 -label "" -changeCommand "help -popupSimpleMode #1" -label1 (uiRes("m_createPrefWndUI.kToolClipsSimple")) popupSimpleHelpMode; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kHelpLocation")) ; columnLayout -adj true helpLocationColumnLayout; rowLayout; optionMenu -label (uiRes("m_createPrefWndUI.kLanguage")) -cc"prefWndHelpLanguageChanged()" helpLanguagePopup; for ($language in $gAvailableLanguages) { string $a[]; tokenize $language ":" $a; menuItem -label $a[1] $a[1]; } setParent ..; separator; radioCollection; radioButton -label (uiRes("m_createPrefWndUI.kAdskWebSite")) -onCommand "prefWndHelpLocationModeUpdate()" adskWebSiteBtn; separator; radioButton -label (uiRes("m_createPrefWndUI.kCustomPath")) -onCommand "prefWndHelpLocationModeUpdate()" customPathBtn; setParent helpLocationColumnLayout; separator; rowLayout -numberOfColumns 2 -columnAttach2 "left" "left" -columnOffset2 15 2; textField -text (`optionVar -q ("customPathHelpUrl" + $gMayaVersionYear)`) -w 365 -cc "if(`optionVar -ex helpModeHold`) prefWndHelpLocationValueUpdate();" helpDirectoryField; symbolButton -image "navButtonBrowse.png" -c "prefWndHelpLocationBrowser()" browseBtn; setParent helpLocationColumnLayout; setParent ..; setUITemplate -popTemplate; prefsUpdateWindows(); } global proc string getDefaultLocalHelpLocationFromTextFile() { global string $gMayaVersionYear; string $appName = capitalizeString(`about -a`); string $helpLocationTxtFile = ""; string $lineRead = ""; string $defaultLocalHelpLocation = ""; $helpLocationTxtFile = `about -hdd`; $helpLocationTxtFile += $appName + "/" + $gMayaVersionYear + "/HelpLocation.txt"; if(`filetest -e $helpLocationTxtFile`) { int $fileId = `fopen $helpLocationTxtFile "r"`; while(!`feof $fileId`) { $lineRead = `fgetline $fileId`; if (startsWith($lineRead ,"HelpInstallPath=")) { $defaultLocalHelpLocation = `substring $lineRead (size("HelpInstallPath=\"")+1) (size($lineRead)-2)`; } } fclose $fileId; } return $defaultLocalHelpLocation; } global proc updateGhostData(int $which, int $val) { int $curr[] = `displayPref -q -ghostFrames`; if (0 == $which) { displayPref -ghostFrames $val $curr[1] $curr[2]; } else if (1 == $which) { displayPref -ghostFrames $curr[0] $val $curr[2]; } else { displayPref -ghostFrames $curr[0] $curr[1] $val; } } global proc prefsCreateDisplay() { global string $gPreferenceWindow; global string $gMaxTexResSliderStr; global string $gLineWidthSliderStr; setParent $gPreferenceWindow; string $parent = "prefDisplayCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kPerformance")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label " " -label1 (uiRes("m_createPrefWndUI.kRenderSwatches")) -ann (uiRes("m_createPrefWndUI.kRenderSwatchesAnnot")) -cw 2 220 -cc1 "optionVar -iv enableSwatchRendering #1" swatchRenderingCBG; optionMenuGrp -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kMaxSizeForSwatchGen")) -annotation (uiRes("m_createPrefWndUI.kMaxSizeForSwatchGenAnnot")) -changeCommand "prefSetSwatchGenSize" swatchGenSizeMenu; menuItem -label (uiRes("m_createPrefWndUI.kSwatchOff")) -data 0; menuItem -label (uiRes("m_createPrefWndUI.kSwatchSize1")) -data 512; menuItem -label (uiRes("m_createPrefWndUI.kSwatchSize2")) -data 1000; menuItem -label (uiRes("m_createPrefWndUI.kSwatchSize3")) -data 2000; menuItem -label (uiRes("m_createPrefWndUI.kSwatchSize4")) -data 4000; menuItem -label (uiRes("m_createPrefWndUI.kSwatchSize5")) -data 6000; menuItem -label (uiRes("m_createPrefWndUI.kSwatchSize6")) -data 8000; menuItem -label (uiRes("m_createPrefWndUI.kSwatchSize7")) -data 10000; menuItem -label (uiRes("m_createPrefWndUI.kSwatchSize8")) -data 12000; menuItem -label (uiRes("m_createPrefWndUI.kSwatchCustom")) -data -1; // custom must be last intFieldGrp -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kSwatchCustomLabel")) -annotation `uiRes("m_createPrefWndUI.kMaxSizeForSwatchGenAnnot")` -changeCommand "prefSetSwatchGenSize" swatchGenSizeField; optionMenuGrp -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kMaterialLoadingMode")) -annotation (uiRes("m_createPrefWndUI.kMaterialLoadingModeAnnot")) -changeCommand "prefSetMaterialLoadingMode" materialLoadingModeMenuGrp; menuItem -label (uiRes("m_createPrefWndUI.kImmediate")); menuItem -label (uiRes("m_createPrefWndUI.kDeferred")); menuItem -label (uiRes("m_createPrefWndUI.kParallel")); checkBoxGrp -numberOfCheckBoxes 1 -columnWidth 2 220 -label " " -label1 (uiRes("m_createPrefWndUI.kGenerateUvPreviews")) -annotation (uiRes("m_createPrefWndUI.kGenerateUvPreviewsAnnot")) -changeCommand1 "optionVar -iv generateUVTilePreviewsOnSceneLoad #1" generateUvTilePreviewCBG; checkBoxGrp -ncb 1 -label " " -label1 (uiRes("m_createPrefWndUI.kStartVp2Paused")) -ann (uiRes("m_createPrefWndUI.kStartVp2PausedAnnot")) -cw 2 220 -cc1 "optionVar -iv vp2PauseState #1" startVp2PausedCBG; string $on = (uiRes("m_createPrefWndUI.kOn")); string $off = (uiRes("m_createPrefWndUI.kOff")); if (isLegacyViewportEnabled()) { separator; frameLayout -label (uiRes("m_createPrefWndUI.kLegacyDefaultViewportSettings")); columnLayout -adj true; radioButtonGrp -nrb 2 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kFastInteraction")) -labelArray2 $on $off -on1 "if (!`exists gridMenuUpdate`) {source buildDisplayMenu;} doFastInteractionItem on" -on2 "if (!`exists gridMenuUpdate`) {source buildDisplayMenu;} doFastInteractionItem off" fastRBG; $gMaxTexResSliderStr = `intSliderGrp -label (uiRes("m_createPrefWndUI.kMaxTextureDisplay")) -columnWidth 1 155 -field true -annotation (uiRes("m_createPrefWndUI.kMaxWidthAndHeightAnnot")) -minValue 16 -maxValue 8192 -fieldMinValue 16 -fieldMaxValue 8192 -dragCommand ("updateMaxTextureResolution #1") -changeCommand ("updateMaxTextureResolution #1") -value 4096 maxTextureResolutionSlider`; rowLayout -nc 2 -cw 1 155 -cat 1 "both" 0 -cal 1 "right" -adj 2 viewportTexturesLayout; string $viewportTextures = `text -label (uiRes("m_createPrefWndUI.kBakedViewportTextures")) `; intSliderGrp -label (uiRes("m_createPrefWndUI.kFast")) -extraLabel (uiRes("m_createPrefWndUI.kHighQuality")) -field 0 -min 0 -max 6 -columnWidth 1 30 -columnWidth 3 70 -changeCommand "doFastViewportTextures #1" fastViewportTextures; setParent ..; } setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kView")) ; columnLayout -adj true; string $originAxis = (uiRes("m_createPrefWndUI.kOriginAxis")); checkBoxGrp -numberOfCheckBoxes 2 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kAxes")) -labelArray2 (uiRes("m_createPrefWndUI.kViewAxis")) $originAxis -changeCommand1 "ToggleViewAxis" -changeCommand2 "ToggleOriginAxis" axisCBG; string $hide = (uiRes("m_createPrefWndUI.kHide")); radioButtonGrp -nrb 2 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kGridPlane")) -labelArray2 (uiRes("m_createPrefWndUI.kShowOption")) $hide -on1 "grid -tgl on" -on2 "grid -tgl off" gridRBG; radioButtonGrp -nrb 2 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kActiveObjectPivots")) -labelArray2 $on $off -on1 "displayPref -activeObjectPivots true" -on2 "displayPref -activeObjectPivots false" activeObjectPivotsRBG; string $reduced = (uiRes("m_createPrefWndUI.kReduced")); string $none = (uiRes("m_createPrefWndUI.kNoneRadio")); radioButtonGrp -nrb 3 -columnWidth 1 155 -columnWidth 4 65 -label (uiRes("m_createPrefWndUI.kWireframeOnShaded")) -labelArray3 (uiRes("m_createPrefWndUI.kFull")) $reduced $none -on1 "displayPref -wsa \"full\"" -on2 "displayPref -wsa \"reduced\"" -on3 "displayPref -wsa \"none\"" wireframeOnShadedActiveRBG; radioButtonGrp -nrb 2 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kRegionOfEffect")) -labelArray2 $on $off -on1 "displayPref -regionOfEffect true" -on2 "displayPref -regionOfEffect false" regionOfEffectRBG; radioButtonGrp -nrb 2 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kShadeTemplates")) -labelArray2 $on $off -on1 "displayPref -shadeTemplates true" -on2 "displayPref -shadeTemplates false" shadeTemplatesRBG; radioButtonGrp -nrb 2 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kDisplayGradient")) -labelArray2 $on $off -on1 "displayPref -displayGradient true" -on2 "displayPref -displayGradient false" displayGradientRBG; $gLineWidthSliderStr = `floatSliderGrp -label (uiRes("m_createPrefWndUI.kLineWidth")) -field true -minValue 1.0 -maxValue 10.0 -precision 1.0 -fieldMinValue 1.0 -fieldMaxValue 10.0 -dragCommand("updateLineWidth #1") -changeCommand("updateLineWidth #1") lineWidthSlider`; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kVPTwoViewport")) ; columnLayout -adj true; optionMenuGrp -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kVPTwoRenderingEngine")) -annotation (uiRes("m_createPrefWndUI.kVPTwoRenderingEngineAnnot")) -changeCommand updateVP2RenderingEngine vp2RenderingEngineMenu; menuItem -label (uiRes("m_createPrefWndUI.kVPTwoRenderingDirectXEleven")); menuItem -label (uiRes("m_createPrefWndUI.kVPTwoRenderingOpenGL")); if (!`about -mac`) { menuItem -label (uiRes("m_createPrefWndUI.kVPTwoRenderingOpenGLCoreProfileCompat")); } menuItem -label (uiRes("m_createPrefWndUI.kVPTwoRenderingOpenGLCoreProfile")); if (isLegacyViewportEnabled()) { optionMenuGrp -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kViewportRenderer")) -annotation (uiRes("m_createPrefWndUI.kViewportRendererAnnot")) -changeCommand "optionVar -iv viewportRenderer `optionMenuGrp -query -select viewportRendererMenu`" viewportRendererMenu; menuItem -label (uiRes("m_createPrefWndUI.kDefaultQualityRendering")); menuItem -label (uiRes("m_createPrefWndUI.kOGSRenderer")); } setParent $parent; separator; setUITemplate -popTemplate; prefsUpdateDisplay(); } global proc updateVP2RenderingEngine() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $renderingEngine = `optionMenuGrp -query -value vp2RenderingEngineMenu`; $renderingEngine = renderingEngine_PreferenceFromLabel($renderingEngine); setRenderingEngineInModelPanel $renderingEngine; updateViewportRendererMenu $renderingEngine; } global proc int textureMakePowerOfTwo(int $sz) // Description // // Given an integer, make it a power of 2. // { int $prevSize = 0, $nextSize = 1; while ($nextSize < $sz ){ $prevSize = $nextSize; $nextSize = $nextSize * 2; } int $newSize; if(($sz - $prevSize) < ($nextSize - $sz)){ $newSize = $prevSize; }else{ $newSize = $nextSize; } return $newSize; } global proc prefSetSwatchGenSize() { string $items[] = `optionMenuGrp -q -itemListShort swatchGenSizeMenu`; int $selected = int(`optionMenuGrp -q -select swatchGenSizeMenu`) - 1; int $data = 0; if ($selected < (size($items) - 1)) { intFieldGrp -edit -enable false swatchGenSizeField; $data = `menuItem -q -data $items[$selected]`; } else { intFieldGrp -edit -enable true swatchGenSizeField; $data = `intFieldGrp -q -v1 swatchGenSizeField`; } optionVar -iv maxImageSizeForSwatchGen $data; } global proc prefSetMaterialLoadingMode() { int $value = `optionMenuGrp -q -select materialLoadingModeMenuGrp`; switch( $value ) { case 1: displayPref -mlm "immediate"; break; case 2: displayPref -mlm "deferred"; break; case 3: displayPref -mlm "parallel"; break; } optionVar -iv materialLoadingMode $value; } global proc updateCadenceLineWorkingUnit() { float $fps = getCadenceLineWorkingUnitInFPS(); optionVar -fv animEdCadenceLineFreq $fps; if(`floatField -exists animEdCadenceLineFreq`) { floatField -edit -v $fps animEdCadenceLineFreq; } } global proc prefAnimEdCadenceLineChanged() { int $value = `optionMenu -q -select animEdCadenceLineType`; int $enableFreq = 0; optionVar -iv animEdCadenceLineType $value; switch( $value ) { case 1: // Working Units updateCadenceLineWorkingUnit(); break; case 2: // Custom $enableFreq = 1; break; } if(`floatField -exists animEdCadenceLineFreq`) { floatField -edit -enable $enableFreq animEdCadenceLineFreq; } } global proc prefGraphEdValueLineDisplayChanged() { int $value = `optionMenuGrp -q -select graphEdValueLineDisplayOpts`; switch( $value ) { case 1: optionVar -sv graphEdValueLineDisplay "On"; break; case 2: optionVar -sv graphEdValueLineDisplay "Off"; break; } } global proc prefGraphEdValueLineIntervalChanged(float $value) { /* TEMPORARILY DISABLING THE SHORT LINES FEATURE if ($value == 0.0) { optionMenuGrp -e -en false graphEdValueLineLengthOpts; } else { optionMenuGrp -e -en true graphEdValueLineLengthOpts; }*/ optionVar -fv graphEdValueLineInterval $value; } global proc prefGraphEdValueMinLinesChanged(float $value) { optionVar -iv graphEdValueMinLines $value; } // TEMPORARILY DISABLING THE SHORT LINES FEATURE global proc prefTimeEditorGranularityChanged(int $value) { optionVar -iv timeEditorGranularity $value; } global proc prefTimeEditorSnapToleranceChanged(int $value) { optionVar -iv timeEditorSnapTolerance $value; timeEditorPanel -e -snapTolerance $value timeEditorPanel1TimeEd; } global proc prefTimeEditorMinimumClipWidthChanged(int $value) { optionVar -iv timeEditorMinimumClipWidth $value; timeEditorPanel -e -minClipWidth $value timeEditorPanel1TimeEd; } global proc updateMaxTextureResolution( int $sz ) { global string $gMaxTexResSliderStr; int $newSize = textureMakePowerOfTwo($sz); intSliderGrp -e -value $newSize $gMaxTexResSliderStr; displayPref -maxTextureResolution $newSize; } global proc prefsCreateNURBS() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefNURBSCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } int $hasSurfaces = `isTrue SurfaceUIExists`; // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kNURBSDisplay")) ; columnLayout -adj true; string $editPoints = (uiRes("m_createPrefWndUI.kEditPoints")); string $hulls = (uiRes("m_createPrefWndUI.kHulls")); string $CVs = (uiRes("m_createPrefWndUI.kCVs")); checkBoxGrp -ncb 3 -columnWidth 4 80 -label (uiRes("m_createPrefWndUI.kNewCurves")) -labelArray3 $editPoints $hulls $CVs -cc1 "toggle -nc -ep -state #1" -cc2 "toggle -nc -hull -state #1" -cc3 "toggle -nc -cv -state #1" controlCBG1; if( $hasSurfaces ) { checkBoxGrp -ncb 2 -label (uiRes("m_createPrefWndUI.kNewSurfaces")) -labelArray2 $editPoints $hulls -cc1 "toggle -ns -ep -state #1" -cc2 "toggle -ns -hull -state #1" controlNewSurface1; checkBoxGrp -ncb 2 -label "" -labelArray2 $CVs (uiRes("m_createPrefWndUI.kOrigins")) -cc1 "toggle -ns -cv -state #1" -cc2 "toggle -ns -origin -state #1" controlNewSurface2; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kSurfaceDivisions")) -min 0 -max 16 -fmx 64 -cc "displaySmoothness -dc -du #1;displaySmoothness -dc -dv #1;" nurbsDivUV; } intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kCurveDivisions")) -min 1 -max 64 -fmx 128 -cc "displaySmoothness -dc -pw #1" nurbsDivW; if( $hasSurfaces ) { intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kShadedDivisions")) -min 1 -max 16 -fmx 64 -cc "displaySmoothness -dc -ps #1" nurbsDivS; } radioButtonGrp -numberOfRadioButtons 2 -label (uiRes("m_createPrefWndUI.kSurfacePrecision")) -label1 (uiRes("m_createPrefWndUI.kStandardPrecision")) -label2 (uiRes("m_createPrefWndUI.kHigh")) -on1 "toggle -hpn -state 0;" -on2 "toggle -hpn -state 1;" highPrecisionNurbsRadio; setParent $parent; setUITemplate -popTemplate; prefsUpdateNURBS(); } global proc prefsCreatePolys() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefPolysCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } if (!`isTrue "PolygonsExists"`) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kPolygonDisplay")) ; columnLayout -adj true; // vertices drawing style string $normals =(uiRes("m_createPrefWndUI.kNormals")); string $backCulling =(uiRes("m_createPrefWndUI.kBackculling")); checkBoxGrp -numberOfCheckBoxes 3 -columnWidth 4 100 -label (uiRes("m_createPrefWndUI.kVertices")) -labelArray3 (uiRes("m_createPrefWndUI.kDisplay")) $normals $backCulling -cc1 "polyOptions -np -dv #1" -on2 "int $dv=`checkBoxGrp -q -v2 polyFacetDispCheck1`; int $v[] = `polyOptions -q -np -f`; if($dv) { if($v[0]) polyOptions -np -dn 1 -pf; else polyOptions -np -dn 1 -pt; } else polyOptions -np -dn 1 -pt" -of2 "int $dv=`checkBoxGrp -q -v2 polyFacetDispCheck1`; if($dv) polyOptions -np -dn 1 -f; else polyOptions -np -dn 0;" -cc3 "polyOptions -np -bcv #1" polyVertDispCheck; floatSliderGrp -label (uiRes("m_createPrefWndUI.kVertexSize")) -field true /* -cal 1 left */ -min 1 -max 10 -cc "polyOptions -np -sv #1" polyVertexSizeSlider; separator; string $softHard = (uiRes("m_createPrefWndUI.kSoftHard")); string $hardColors = (uiRes("m_createPrefWndUI.kHardColors")); string $onlyHard = (uiRes("m_createPrefWndUI.kOnlyHard")); radioButtonGrp -numberOfRadioButtons 4 -columnWidth 4 84 -label (uiRes("m_createPrefWndUI.kEdges")) -labelArray4 (uiRes("m_createPrefWndUI.kStandard")) $softHard $hardColors $onlyHard -cc1 "polyOptions -np -ae" -cc2 "polyOptions -np -se" -cc3 "polyOptions -np -hec" -cc4 "polyOptions -np -he" polyEdgeDispRadio; checkBoxGrp -numberOfCheckBoxes 3 -columnWidth 4 84 -label (uiRes("m_createPrefWndUI.kHighlight")) -label1 (uiRes("m_createPrefWndUI.kBorderEdges")) -label2 (uiRes("m_createPrefWndUI.kTextureBorders")) -label3 (uiRes("m_createPrefWndUI.kCreaseEdges")) -cc1 "polyOptions -np -db #1" -cc2 "polyOptions -np -dmb #1" -cc3 "polyOptions -np -dce #1" polyEdgeHiliteDispCheck; floatSliderGrp -label (uiRes("m_createPrefWndUI.kEdgeWidth")) -field true /* -cal 1 left */ -min 1 -max 10 -cc "polyOptions -np -sb #1" polyBordEdgeSizeSlider; separator; checkBoxGrp -numberOfCheckBoxes 2 -label (uiRes("m_createPrefWndUI.kFaces")) -labelArray2 (uiRes("m_createPrefWndUI.kCenters")) $normals -cc1 "polyOptions -np -dc #1" -on2 "int $dv=`checkBoxGrp -q -v2 polyVertDispCheck`; int $v[] = `polyOptions -q -np -pt`; if($dv) {if($v[0]) polyOptions -np -dn 1 -pf; else polyOptions -np -dn 1 -f; } else polyOptions -np -dn 1 -f" -of2 "int $dv=`checkBoxGrp -q -v2 polyVertDispCheck`; if($dv) polyOptions -np -dn 1 -pt; else polyOptions -np -dn 0;" polyFacetDispCheck1; string $nonPlanar = (uiRes("m_createPrefWndUI.kNonPlanar")); checkBoxGrp -numberOfCheckBoxes 2 -label "" -labelArray2 (uiRes("m_createPrefWndUI.kTriangles")) $nonPlanar -cc1 "polyOptions -np -dt #1" -cc2 "polyOptions -np -dw #1" polyFacetDispCheck2; separator; string $edges = (uiRes("m_createPrefWndUI.kEdgesOption")); checkBoxGrp -numberOfCheckBoxes 2 -label (uiRes("m_createPrefWndUI.kShowItemNumbers")) -labelArray2 (uiRes("m_createPrefWndUI.kVerticesOption")) $edges -cc "int $dv = `checkBoxGrp -q -v1 polyItemDispCheck1`;\ int $de = `checkBoxGrp -q -v2 polyItemDispCheck1`;\ int $df = `checkBoxGrp -q -v1 polyItemDispCheck2`;\ int $dm = `checkBoxGrp -q -v2 polyItemDispCheck2`;\ polyOptions -np -din $dv $de $df $dm; " polyItemDispCheck1; string $UVs = (uiRes("m_createPrefWndUI.kUVs")); checkBoxGrp -numberOfCheckBoxes 2 -label "" -labelArray2 (uiRes("m_createPrefWndUI.kFacesOption")) $UVs -cc "int $dv = `checkBoxGrp -q -v1 polyItemDispCheck1`;\ int $de = `checkBoxGrp -q -v2 polyItemDispCheck1`;\ int $df = `checkBoxGrp -q -v1 polyItemDispCheck2`;\ int $dm = `checkBoxGrp -q -v2 polyItemDispCheck2`;\ polyOptions -np -din $dv $de $df $dm; " polyItemDispCheck2; floatSliderGrp -label (uiRes("m_createPrefWndUI.kNormalsSize")) -field true -min 0.02 -max 10 -precision 2 -changeCommand "polyOptions -newPolymesh -sizeNormal #1" polyNormalSizeSlider; floatSliderGrp -label (uiRes("m_createPrefWndUI.kUVSize")) -field true /* -cal 1 left */ -min 1 -max 10 -cc "polyOptions -np -suv #1" polyUVSizeSlider; separator; checkBoxGrp -numberOfCheckBoxes 1 -label (uiRes("m_createPrefWndUI.kColor")) -label1 (uiRes("m_createPrefWndUI.kColoredShading")) -cw 2 160 -on1 "polyOptions -np -cs 1;" -of1 "polyOptions -np -cs 0;" colorShadedDisplayCheck; optionMenuGrp -label (uiRes("m_createPrefWndUI.kColorMaterial")) -cc "prefPolyChangeMaterial" colorMaterialPopup; menuItem -label (uiRes("m_createPrefWndUI.kNoneMenu")) materialNoneMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kAmbient")) materialAmbientMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kAmbientDiffuse")) materialAmbDiffMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kDiffuse")) materialDiffuseMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kSpecular")) materialSpecularMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kEmission")) materialEmissionMenuItem; setParent -m ..; optionMenuGrp -label (uiRes("m_createPrefWndUI.kMaterialBlend")) -cc "prefPolyMaterialBlend" materialBlendPopup; menuItem -label (uiRes("m_createPrefWndUI.kOverwrite")) blendOverwriteItem; menuItem -label (uiRes("m_createPrefWndUI.kAdd")) blendAddMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kSubtract")) blendSubractItem; menuItem -label (uiRes("m_createPrefWndUI.kMultiply")) blendMultiplyItem; menuItem -label (uiRes("m_createPrefWndUI.kDivide")) blendDivideItem; menuItem -label (uiRes("m_createPrefWndUI.kAverage")) blendAverageItem; menuItem -label (uiRes("m_createPrefWndUI.kModulate")) blendModulateItem; separator; checkBoxGrp -numberOfCheckBoxes 1 -label (uiRes("m_createPrefWndUI.kEmptyLabel")) -l1 (uiRes("m_createPrefWndUI.kDisplayAlphaAsGreyScale")) -v1 on -on1 "polyOptions -np -dal 1; optionVar -intValue displayAlphaAsGreyScale 1" -of1 "polyOptions -np -dal 0; optionVar -intValue displayAlphaAsGreyScale 0" displayAlphaAsGreyScaleCheck; separator; string $colorChannelStrings[] = {"none", "ambient", "ambientDiffuse", "diffuse", "specular", "emission"}; optionMenuGrp -label (uiRes("m_createPrefWndUI.kBackfaceCulling")) -cc "prefPolyChangeCulling" polyFBackCullPopup; menuItem -label (uiRes("m_createPrefWndUI.kOffMenu")) backfaceOffMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kOnOption")) backfaceOnMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kKeepWire")) backfaceWireMenuItem; menuItem -label (uiRes("m_createPrefWndUI.kKeepHardEdges")) backfaceHardEdgeMenuItem; setParent -m ..; separator; optionMenuGrp -label (uiRes("m_createPrefWndUI.kDefaultSmoothDrawType")) -changeCommand "defaultSmoothDrawTypeChanged_CB" polyDefaultSmoothDrawType_OMG; menuItem -label (uiRes("m_createPrefWndUI.kCatmullClarkSubdivision")); menuItem -label (uiRes("m_createPrefWndUI.kOpenSubdivCatmullClarkUniformSubdivision")); menuItem -label (uiRes("m_createPrefWndUI.kOpenSubdivCatmullClarkAdaptiveSubdivision")); setParent -m ..; setParent ..; setParent ..; setParent $parent; setUITemplate -popTemplate; prefsUpdatePolys(); } global proc prefsCreateSubdivs() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefSubdivsCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kSubdivsDisplay")) ; columnLayout -adj true; string $numbers = (uiRes("m_createPrefWndUI.kNumbers")); radioButtonGrp -nrb 2 -label (uiRes("m_createPrefWndUI.kComponentDisplay")) -labelArray2 (uiRes("m_createPrefWndUI.kPoints")) $numbers -on1 "subdDisplayMode -showComponentsAsNumerals 0" -on2 "subdDisplayMode -showComponentsAsNumerals 1" subdivDisplayRBG; setParent $parent; setUITemplate -popTemplate; prefsUpdateSubdivs(); } global proc prefsCreateFonts() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefFontsCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kFontsDisplay")) ; columnLayout -adj true; radioButtonGrp -numberOfRadioButtons 1 -cw 2 250 -label "" -label1 (uiRes("m_createPrefWndUI.kDefaultFont")) -on1 "optionVar -iv fontSetOpt 0; displayPref -fm 0; intSliderGrp -e -en false SmallFontsSizeSlider; intSliderGrp -e -en false DefaultFontsSizeSlider" -annotation (uiRes("m_createPrefWndUI.kDefaultFontAnnot")) defaultFontOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 250 -scl defaultFontOpt -label "" -label1 (uiRes("m_createPrefWndUI.kMediumFont")) -on1 "optionVar -iv fontSetOpt 1; displayPref -fm 1; intSliderGrp -e -en false SmallFontsSizeSlider; intSliderGrp -e -en false DefaultFontsSizeSlider" -annotation (uiRes("m_createPrefWndUI.kMediumFontAnnot")) mediumFontOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 250 -scl defaultFontOpt -label "" -label1 (uiRes("m_createPrefWndUI.kCustomFont")) -annotation (uiRes("m_createPrefWndUI.kCustomFontAnnot")) -on1 "optionVar -iv fontSetOpt 2; displayPref -fm 2; intSliderGrp -e -en true SmallFontsSizeSlider; intSliderGrp -e -en true DefaultFontsSizeSlider" customFontOpt; intSliderGrp -label (uiRes("m_createPrefWndUI.kSmallFontsSize")) -field true -min 9 -max 12 -changeCommand "displayPref -sfs #1" SmallFontsSizeSlider; intSliderGrp -label (uiRes("m_createPrefWndUI.kDefaultFontsSize")) -field true -min 9 -max 16 -changeCommand "displayPref -dfs #1" DefaultFontsSizeSlider; setParent $parent; setUITemplate -popTemplate; prefsUpdateFonts(); } global proc prefsCreateManips() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefManipsCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kManipulatorSizes")) ; columnLayout -adj true; floatSliderGrp -field true -label (uiRes("m_createPrefWndUI.kGlobalScale")) -min 0.1 -max 10 -dc "manipOptions -s #1" -cc "manipOptions -s #1" -pre 2 -step 0.01 manipScale; floatSliderGrp -field true -label (uiRes("m_createPrefWndUI.kHandleSize")) -min 4 -max 100 -dc "manipOptions -hs #1" -cc "manipOptions -hs #1" -pre 2 -step 0.5 manipHS; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kLineSize")) -min 1 -max 10 -dc "manipOptions -ls #1" -cc "manipOptions -ls #1" -step 1 manipLS; floatSliderGrp -field true -label (uiRes("m_createPrefWndUI.kLinePickSize")) -min 1 -max 15 -cc "manipOptions -lp #1" -pre 2 -step 1.0 manipLP; floatSliderGrp -field true -label (uiRes("m_createPrefWndUI.kPreviousStateSize")) -min 1 -max 10 -cc "manipOptions -ps #1" -pre 2 -step 0.01 manipPS; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kShowManipulator")) ; columnLayout -adj true; optionMenuGrp -label (uiRes("m_createPrefWndUI.kDefaultManipulator")) -cc "optionVar -iv defaultShowManipulator `optionMenuGrp -query -select defaultManipOpts`" defaultManipOpts; menuItem -label (uiRes("m_createPrefWndUI.kNone")) ; menuItem -label (uiRes("m_createPrefWndUI.kTranslate")) ; menuItem -label (uiRes("m_createPrefWndUI.kRotate")) ; menuItem -label (uiRes("m_createPrefWndUI.kScale")) ; menuItem -label (uiRes("m_createPrefWndUI.kTransform")) ; menuItem -label (uiRes("m_createPrefWndUI.kSmart")) ; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kManipulatorVisibility")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -l (uiRes("m_createPrefWndUI.kHideManipWhen")) -l1 (uiRes("m_createPrefWndUI.kCtrlIsHeld")) -cc "manipOptions -hideManipOnCtrl #1" manipHideOnCtrl_CB; checkBoxGrp -ncb 1 -l "" -l1 (uiRes("m_createPrefWndUI.kShiftIsHeld")) -cc "manipOptions -hideManipOnShift #1" manipHideOnShift_CB; checkBoxGrp -ncb 1 -l "" -l1 (uiRes("m_createPrefWndUI.kCtrlShiftIsHeld")) -cc "manipOptions -hideManipOnShiftCtrl #1" manipHideOnShiftCtrl_CB; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kComponentManipulators")) ; columnLayout -adj true; int $useMiddleMouseRepos[] = `manipOptions -query -middleMouseRepositioning`; checkBoxGrp -label "" -label1 (uiRes("m_createPrefWndUI.kReposition")) -columnWidth 2 240 -value1 $useMiddleMouseRepos[0] -cc "manipOptions -middleMouseRepositioning #1" midMouseRepos; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kManipHandleSelection")) ; columnLayout -adj true; radioButtonGrp -nrb 2 -cw 1 180 -vr -label (uiRes("m_createPrefWndUI.kMRSToolSwitch")) -label1 (uiRes("m_createPrefWndUI.kResettoViewPlaneHandle")) -label2 (uiRes("m_createPrefWndUI.kRememberActiveHandle")) -on1 "manipOptions -rememberActiveHandleAfterToolSwitch 0" -on2 "manipOptions -rememberActiveHandleAfterToolSwitch 1" manipHandleMRSSwitch; radioButtonGrp -nrb 2 -cw 1 180 -vr -label (uiRes("m_createPrefWndUI.kSelectionChange")) -label1 (uiRes("m_createPrefWndUI.kResettoViewPlaneHandle")) -label2 (uiRes("m_createPrefWndUI.kRememberActiveHandle")) -on1 "manipOptions -rememberActiveHandle 0" -on2 "manipOptions -rememberActiveHandle 1" manipHandleSelectionChange; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kPickRange")) -min 1 -max 100 -dc "selectPref -manipClickBoxSize #1" -cc "selectPref -manipClickBoxSize #1" -step 1 manipPickRange; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kManipulatorPlaneHandles")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kPlaneHandle")) -columnWidth 2 240 -changeCommand ("prefWndToggleShowPlaneHandles #1") manipSPH; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kPlaneHandleOffset")) -min 0 -max 100 -dc "manipOptions -pho #1" -cc "manipOptions -pho #1" -step 1 manipPHO; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kPivotManipulator")); columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kPivotManipRotationHandle")) -columnWidth 2 240 -changeCommand ("prefWndToggleShowPivotManipHandle #1") manipSPR; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kPivotManipRotationSize")) -min 30 -max 100 -dc "manipOptions -pro #1" -cc "manipOptions -pro #1" -step 1 manipPRO; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kLightManipulator")); columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kShowPenumbraDecayRegions")) -columnWidth 2 240 -changeCommand "optionVar -iv manipShowPenumbraDecayRegions #1" penumbraDecayRegions; setParent $parent; setUITemplate -popTemplate; prefsUpdateManips(); } global proc prefsCreateSettings() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefSettingsCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kWorldCoordinateSystem")) ; columnLayout -adj true; string $z = (uiRes("m_createPrefWndUI.kZ")); radioButtonGrp -nrb 2 -label (uiRes("m_createPrefWndUI.kUpAxis")) -labelArray2 (uiRes("m_createPrefWndUI.kY")) $z -on1 "setUpAxis \"y\"" -on2 "setUpAxis \"z\"" upAxisRBG; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kWorkingUnits")) ; columnLayout -adj true; optionMenuGrp -label (uiRes("m_createPrefWndUI.kLinearOptions")) -cc ("prefWndUnitsChanged \"linear\"") linearOpts; menuItem -label (uiRes("m_createPrefWndUI.kMillimeter")); // menu 1 menuItem -label (uiRes("m_createPrefWndUI.kCentimeter")); // menu 2 menuItem -label (uiRes("m_createPrefWndUI.kMeter")); // menu 3 // menuItem -label "kilometer"; menuItem -label (uiRes("m_createPrefWndUI.kInch")); // menu 4 menuItem -label (uiRes("m_createPrefWndUI.kFoot")); // menu 5 menuItem -label (uiRes("m_createPrefWndUI.kYard")); // menu 6 // menuItem -label "mile"; separator; optionMenuGrp -label (uiRes("m_createPrefWndUI.kAngular")) -cc ("prefWndUnitsChanged \"angular\"") angularOpts; menuItem -label (uiRes("m_createPrefWndUI.kDegrees")); menuItem -label (uiRes("m_createPrefWndUI.kRadians")); separator; optionMenuGrp -label (uiRes("m_createPrefWndUI.kTime")) -cc ("prefWndTimeUnitsChanged \"timeOpts\"") timeOpts; for($i = 0; $i < getTimeUnitDisplayStringCount(); $i++) { string $displayString = getTimeUnitDisplayString($i); menuItem -label $displayString; } scriptJob -permanent -parent timeOpts -event timeUnitChanged "prefWndUpdateFrameRateList"; separator; checkBoxGrp -label "" -label1 (uiRes("m_createPrefWndUI.kKeepKeys")) -cw 2 240 updateKeys; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kTolerance")) ; columnLayout -adj true; float $min = 0.0001; floatSliderGrp -field 1 -label (uiRes("m_createPrefWndUI.kPositional")) -min $min -max 0.1 -fmn $min -fmx 20.0 -cc "tolerance -linear #1" -pre 5 -step 0.05 posTolFloatSliderGrp; floatSliderGrp -field 1 -label (uiRes("m_createPrefWndUI.kTangential")) -min $min -max 1.0 -fmn $min -fmx 20.0 -pre 5 -step 0.05 -cc "tolerance -a #1" tanTolFloatSliderGrp; setParent $parent; setUITemplate -popTemplate; prefsUpdateSettings(); } global proc changeQuadDrawOM() { string $MMBDescriptionArray[] = { "invalid", (uiRes("m_createPrefWndUI.kTweakLabel")), (uiRes("m_createPrefWndUI.kRelaxSelectionLabel")), (uiRes("m_createPrefWndUI.kInsertEdgeLoopMidLabel")), (uiRes("m_createPrefWndUI.kMoveEdgeLoopLabel")), (uiRes("m_createPrefWndUI.kExtendLoopLabel")) }; int $leftMouseOMValueNum = `optionMenu -q -sl MT_LMBOM`; nexOpt -e qdNoModifierKeys $leftMouseOMValueNum; text -e -label $MMBDescriptionArray[$leftMouseOMValueNum] MT_MMBText; int $shiftOMValueNum = `optionMenu -q -sl MT_shiftPlusLMBOM`; nexOpt -e qdShiftModifierKeys $shiftOMValueNum; text -e -label $MMBDescriptionArray[$shiftOMValueNum] MT_shiftPlusMMBText; int $ctrlOMValueNum = `optionMenu -q -sl MT_ctrlPlusLMBOM`; nexOpt -e qdControlModifierKeys $ctrlOMValueNum; text -e -label $MMBDescriptionArray[$ctrlOMValueNum] MT_ctrlPlusMMBText; int $ctrlShiftOMValueNum = `optionMenu -q -sl MT_ctrlPlusShiftPlusLMBOM`; nexOpt -e qdControlShiftModifierKeys $ctrlShiftOMValueNum; text -e -label $MMBDescriptionArray[$ctrlShiftOMValueNum] MT_ctrlPlusShiftPlusMMBText; int $tabOMValueNum = `optionMenu -q -sl MT_tabPlusLMBOM`; nexOpt -e qdTabModifierKeys $tabOMValueNum; text -e -label $MMBDescriptionArray[$tabOMValueNum] MT_tabPlusMMBText; int $defaultValNum = 1; int $customValNum = 2; if ($leftMouseOMValueNum == 1 && $shiftOMValueNum == 2 && $ctrlOMValueNum == 3 && $ctrlShiftOMValueNum == 4 && $tabOMValueNum == 5){ if (`optionMenu -q -sl MT_presetOM` == $customValNum){ optionMenu -e -sl $defaultValNum MT_presetOM; } } else { optionMenu -e -sl $customValNum MT_presetOM; } } global proc changeQuadDrawPresetOM() { if (`optionMenu -q -sl MT_presetOM`==1){ nexOpt -e qdNoModifierKeys 1; optionMenu -e -sl 1 MT_LMBOM; nexOpt -e qdShiftModifierKeys 2; optionMenu -e -sl 2 MT_shiftPlusLMBOM; nexOpt -e qdControlModifierKeys 3; optionMenu -e -sl 3 MT_ctrlPlusLMBOM; nexOpt -e qdControlShiftModifierKeys 4; optionMenu -e -sl 4 MT_ctrlPlusShiftPlusLMBOM; nexOpt -e qdTabModifierKeys 5; optionMenu -e -sl 5 MT_tabPlusLMBOM; changeQuadDrawOM(); } } global proc prefsCreateAnim() { global string $gPreferenceWindow; global string $gPlayBackSlider; setParent $gPreferenceWindow; string $parent = "prefAnimCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (localizedUIComponentLabel("Time Slider")); columnLayout -adj true; // create the frame rate list optionMenuGrp -label (uiRes("m_createPrefWndUI.kFrameRate")) -cc ("prefWndTimeUnitsChanged \"timeSliderTimeOpts\"") timeSliderTimeOpts; // fill the frame rate list for($i = 0; $i < getTimeUnitDisplayStringCount(); $i++) { string $displayString = getTimeUnitDisplayString($i); menuItem -label $displayString; } scriptJob -permanent -parent timeSliderTimeOpts -event timeUnitChanged "prefWndUpdateFrameRateList"; checkBoxGrp -label "" -label1 (uiRes("m_createPrefWndUI.kTimeSliderUpdateKeys")) -cw 2 240 timeSliderUpdateKeys; separator; // Changing the playback range can sometimes affect the start/end // range. Update it in the callback. // timeFieldGrp -label (uiRes("m_createPrefWndUI.kPlaybackStartEnd")) -cal 1 "right" -nf 2 -pre 2 -cc ( "playbackOptions -e -min #1 -max #2; " + "timeFieldGrp -e -v1 " + "`playbackOptions -q -ast` -v2 " + "`playbackOptions -q -aet` rangeSliderBounds; " + "timeFieldGrp -e -v1 " + "`playbackOptions -q -min` -v2 " + "`playbackOptions -q -max` timeSliderBounds;" ) timeSliderBounds; // Changing the start/end range can sometimes affect the playback // range. Update it in the callback. // timeFieldGrp -label (uiRes("m_createPrefWndUI.kAnimationStartEnd")) -cal 1 "right" -nf 2 -pre 2 -cc ( "playbackOptions -e -ast #1 -aet #2; " + "timeFieldGrp -e -v1 " + "`playbackOptions -q -ast` -v2 " + "`playbackOptions -q -aet` rangeSliderBounds; " + "timeFieldGrp -e -v1 " + "`playbackOptions -q -min` -v2 " + "`playbackOptions -q -max` timeSliderBounds;" ) rangeSliderBounds; separator; string $twoX = "2x"; string $fourX = "4x"; radioButtonGrp -nrb 3 -label (uiRes("m_createPrefWndUI.kHeight")) -labelArray3 "1x" $twoX $fourX -on1 "prefsChangeTimeControlHeight (`optionVar -q timeSliderBaseHeight`)" -on2 "prefsChangeTimeControlHeight (`optionVar -q timeSliderBaseHeight` * 2)" -on3 "prefsChangeTimeControlHeight (`optionVar -q timeSliderBaseHeight` * 4)" timeLineSize; string $active = (uiRes("m_createPrefWndUI.kActive")); string $all = (uiRes("m_createPrefWndUI.kAllFramesOption")); string $none = (uiRes("m_createPrefWndUI.kNoneOption")); string $frameAnnot = (uiRes("m_createPrefWndUI.kFrameAnnot")); radioButtonGrp -label (uiRes("m_createPrefWndUI.kGreaseFrames")) -numberOfRadioButtons 3 -labelArray3 $none $active $all -annotation $frameAnnot -on1 "timeControl -edit -showGreaseFrames \"none\" $gPlayBackSlider;" -on2 "timeControl -edit -showGreaseFrames \"active\" $gPlayBackSlider;" -on3 "timeControl -edit -showGreaseFrames \"all\" $gPlayBackSlider;" showFrames; string $keyTicksAnnot = (uiRes("m_createPrefWndUI.kKeyTickAnnot")); string $channelBox = (localizedUIComponentLabel("Channel Box")); string $channelBoxActive = (uiRes("m_createPrefWndUI.kSmartOption")); radioButtonGrp -label (uiRes("m_createPrefWndUI.kKeyTicks")) -nrb 4 -labelArray4 $none $active $channelBox $channelBoxActive -annotation $keyTicksAnnot -on1 "timeControl -e -showKeys none $gPlayBackSlider" -on2 "timeControl -e -showKeys active $gPlayBackSlider" -on3 "timeControl -e -showKeys $gChannelBoxName $gPlayBackSlider" -on4 "timeControl -e -showKeys $gChannelBoxName -showKeysCombined true $gPlayBackSlider" showTicks; // // Create the "Key tick size" radio buttons // rowLayout -numberOfColumns 6 -columnWidth 1 140 -cat 1 "both" 0 -columnWidth 2 110 -columnWidth 3 110 -columnWidth 4 110 -columnWidth 5 110 -columnAlign 1 "right"; text -label (uiRes("m_createPrefWndUI.kKeyTickSize")); radioCollection keyTickSizeRadioButton; radioButton -label "1x" -onCommand "timeControl -e -tickSize 1 $gPlayBackSlider"; radioButton -label "2x" -onCommand "timeControl -e -tickSize 2 $gPlayBackSlider"; radioButton -label "3x" -onCommand "timeControl -e -tickSize 3 $gPlayBackSlider"; radioButton -label "4x" -onCommand "timeControl -e -tickSize 4 $gPlayBackSlider"; radioButton -label "5x" -onCommand "timeControl -e -tickSize 5 $gPlayBackSlider"; setParent ..; // // Create the time display options and attach a script job on "timeUnitChanged" event // string $timeDisplayFrames = (uiRes("m_createPrefWndUI.kTimeDisplayFrames")); string $timeDisplayTimeCodeAll = (uiRes("m_createPrefWndUI.kTimeDisplayTimeCode")); string $timeDisplayTimeCode = (uiRes("m_createPrefWndUI.kTimeDisplayTimeCode2")); radioButtonGrp -label (uiRes("m_createPrefWndUI.kTimeDisplay")) -nrb 3 -labelArray3 $timeDisplayFrames $timeDisplayTimeCodeAll $timeDisplayTimeCode -on1 "animDisplay -e -timeCode \"frame\";" -on2 "animDisplay -e -timeCode \"fulltimecode\";" -on3 "animDisplay -e -timeCode \"timecode\";" timeDisplay; scriptJob -permanent -parent timeDisplay -event timeUnitChanged "prefWndUpdateTimeDisplayMenu"; // // Set the time display radio button based on the setting // $timeDisplayModeValue = `optionVar -query timeDisplayMode`; if($timeDisplayModeValue == "frame") radioButtonGrp -e -sl 1 timeDisplay; else if($timeDisplayModeValue == "fulltimecode") radioButtonGrp -e -sl 2 timeDisplay; else if($timeDisplayModeValue == "timecode") radioButtonGrp -e -sl 3 timeDisplay; checkBoxGrp -ncb 2 -cw 2 150 -label (uiRes("m_createPrefWndUI.kTimeSliderChannelBoxSync")) -label1 (uiRes("m_createPrefWndUI.kTimeSliderSyncTimeline")) -label2 (uiRes("m_createPrefWndUI.kTimeSliderSyncGE")) -cc1 "toggleChannelBoxTimelineSync #1" -cc2 "toggleChannelBoxGraphEdSync #1" -v1 `timeControl -q -showKeysCombined timeControl1` -v2 `optionVar -query keyUseChannelBox` timeSliderChannelBoxSync; checkBoxGrp -ncb 1 -cw 2 100 -label (uiRes("m_createPrefWndUI.kOptions")) -label1 (uiRes("m_createPrefWndUI.kSnappingOption")) -cc "timeControl -e -snap #1 $gPlayBackSlider;" timeLine; intFieldGrp -label (uiRes("m_createPrefWndUI.kTickSpan")) -cc "timeControl -e -tsp `intFieldGrp -query -value1 timeLabelSpacing` $gPlayBackSlider" timeLabelSpacing; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kPlayback")) ; columnLayout -adj true; rowLayout -nc 4 -cw 1 140 -cw 3 85 -cw 4 90 -cat 1 "both" 0 -cat 3 "both" 0 -cal 1 "right" -cal 3 "right" playbackRow; text -label (uiRes("m_createPrefWndUI.kPlaybackSpeed")) ; optionMenu -label "" -cc ("prefWndAnimOptionChanged 1") speedOpts; // Create the menu items. Dynamically determine // the labels on them later, with a call to prefWndAnimOptionChanged. // menuItem playbackSpeedFree; menuItem playbackSpeedNormal; menuItem playbackSpeedHalf; menuItem playbackSpeedTwice; menuItem playbackSpeedOther; text -enable 0 -label (uiRes("m_createPrefWndUI.kOtherSpeed")) playbackSpeedT; // The initial value of this field determines the // "fps" label on the "Other" menu entry, the // first time it is shown. // floatField -enable 0 -value 0 -minValue 0.0 -precision 2 -cc ("prefWndAnimOptionChanged 1") playbackSpeedFF; setParent ..; rowLayout -nc 2 -cw2 140 90 -cat 1 "both" 0 -cal 1 "right" playbackByRow; text -label (uiRes("m_createPrefWndUI.kPlaybackBy")) ; // Sometimes we don't get the -by rate we've requested. // Update it after the command's executed so we show the // resulting value. // floatField -value 1 -minValue 0.001 -precision 3 -tze false -cc ( "playbackOptions -by #1; " + "floatField -e -value " + "`playbackOptions -q -by` playbackByFF" ) playbackByFF; setParent ..; optionMenuGrp -label (uiRes("m_createPrefWndUI.kMaxPlaybackSpeed")) -cc ("prefWndAnimOptionChanged 1") maxSpeedOpts; menuItem -l (uiRes("m_createPrefWndUI.kFree")) maxPlaybackSpeedFree; menuItem maxPlaybackSpeedNormal; menuItem maxPlaybackSpeedHalf; menuItem maxPlaybackSpeedTwice; separator; radioButtonGrp -nrb 2 -label (uiRes("m_createPrefWndUI.kUpdateview")) -cw 2 100 -cw 3 100 -labelArray2 $active (uiRes("m_createPrefWndUI.kAll")) -on1 "playbackOptions -v \"active\"" -on2 "playbackOptions -v \"all\"" playbackView; string $oscillate = (uiRes("m_createPrefWndUI.kOscillate")); string $continuous = (uiRes("m_createPrefWndUI.kContinuous")); radioButtonGrp -nrb 3 -label (uiRes("m_createPrefWndUI.kLooping")) -cw 2 100 -cw 3 100 -cw 4 100 -labelArray3 (uiRes("m_createPrefWndUI.kOnce")) $oscillate $continuous -on1 "playbackOptions -loop \"once\"" -on2 "playbackOptions -loop \"oscillate\"" -on3 "playbackOptions -loop \"continuous\"" playbackLooping; scriptJob -permanent -parent playbackLooping -event playbackModeChanged "updatePlaybackLoopingRadioButton"; setParent $parent; setUITemplate -popTemplate; // Update the playback speed menu item labels created above. // prefWndAnimOptionChanged 0; // If the window's up when someone else has changed the current time unit, // we should update. // scriptJob -protected -parent $parent -event timeUnitChanged "prefWndAnimOptionChanged 1"; prefsUpdateAnim(); } global proc prefsCreateModeling() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefModelingCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kOutputGeometryType")) ; columnLayout -adj true; string $mixed = (uiRes("m_createPrefWndUI.kMixed")); string $command1 = "prefsUpdateModeling; "; string $errorCmd = "error \""; string $errorText = (uiRes("m_createPrefWndUI.kSetSpecificTypeError")); if( `isTrue "SurfaceUIExists"` ) { radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kOutputGeometryAs")) -label1 (uiRes("m_createPrefWndUI.kNURBSOption")) -on1 "prefsChangeOutputType 0" modelWithType1; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -scl modelWithType1 -label " " -label1 (uiRes("m_createPrefWndUI.kPolygonsType")) -on1 "prefsChangeOutputType 1" modelWithType2; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -scl modelWithType1 -label " " -label1 (uiRes("m_createPrefWndUI.kBeziers")) -on1 "prefsChangeOutputType 3" modelWithType3; if( `licenseCheck -m "edit" -typ "model"` ) { radioButtonGrp -numberOfRadioButtons 1 -scl modelWithType1 -label " " -label1 (uiRes("m_createPrefWndUI.kSubdivSurfaces")) -on1 "prefsChangeOutputType 2" -cw 1 155 modelWithType4; } radioButtonGrp -numberOfRadioButtons 1 -scl modelWithType1 -label " " -label1 $mixed -onCommand1 ($command1 + $errorCmd + $errorText) -cw 1 155 modelWithType5; } setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kNURBSInteraction")) ; columnLayout -adj true; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kInteractionMode")) -label1 (uiRes("m_createPrefWndUI.kEverythingIsTool")) -on1 "prefsChangeToolType 1" modelWithTools1; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -scl modelWithTools1 -label " " -label1 (uiRes("m_createPrefWndUI.kEverythingIsAction")) -on1 "prefsChangeToolType 0" modelWithTools2; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -scl modelWithTools1 -label " " -label1 $mixed -onCommand1 ($command1 + $errorCmd + $errorText) modelWithTools3; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kPolygonsFrame")) ; columnLayout -adjustableColumn true; checkBoxGrp -columnWidth 1 155 -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kConvertComponentSelection")) -changeCommand1 "optionVar -intValue polyAutoConvertAction #1" polyAutoConvert; checkBoxGrp -columnWidth 1 155 -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kCreateMeshesSingleSided")) -changeCommand1 "optionVar -intValue polyCreateMeshesSingleSided #1" polyCreateMeshSingleSided; checkBoxGrp -columnWidth 1 155 -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kSmartCommandSettings")) -changeCommand1 "optionVar -intValue polyAutoInstallAction #1" polySmartCommandSettings; checkBoxGrp -columnWidth 1 155 -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kConvertDisplay")) -annotation (uiRes("m_createPrefWndUI.kConvertDisplayAnnot")) -changeCommand1 "optionVar -intValue polyAutoShowColorPerVertex #1" polyConvertDisplay; checkBoxGrp -columnWidth 1 155 -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kKeepFacesTogether")) -annotation (uiRes("m_createPrefWndUI.kPolyKeepFacesTogetherAnnot")) -changeCommand1 "togglePolyMoveComponents" polyKeepFacesTogether; optionMenuGrp -label (uiRes("m_createPrefWndUI.kDefaultVertexNormalMethod")) -columnWidth 1 155 -changeCommand "defaultVertexNormalMethodChanged_CB" polyDefaultVertexNormalMethod_OMG; menuItem -label (uiRes("m_createPrefWndUI.kVertexNormalsUnweighted")); menuItem -label (uiRes("m_createPrefWndUI.kVertexNormalsAngleWeighted")); menuItem -label (uiRes("m_createPrefWndUI.kVertexNormalsAreaWeighted")); menuItem -label (uiRes("m_createPrefWndUI.kVertexNormalsAngleAndAreaWeighted")); optionMenuGrp -label (uiRes("m_createPrefWndUI.kGlobalSmoothDrawType")) -columnWidth 1 155 -changeCommand "globalSmoothDrawTypeChanged_CB" polyGlobalSmoothDrawType_OMG; menuItem -label (uiRes("m_createPrefWndUI.kCatmullClarkSubdivision")); menuItem -label (uiRes("m_createPrefWndUI.kOpenSubdivCatmullClarkUniformSubdivision")); menuItem -label (uiRes("m_createPrefWndUI.kOpenSubdivCatmullClarkAdaptiveSubdivision")); setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kPolygonTangentSpaceFrame")) ; columnLayout -adjustableColumn true; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kDefaultTangentSpaceCoordinateSystem")) -label1 (uiRes("m_createPrefWndUI.kRightHanded")) -on1 "optionVar -intValue polyDefaultTangentSpace (0 + (`optionVar -q polyDefaultTangentSpace` % 2))" polyDefaultRightHandedTangentSpace; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -scl polyDefaultRightHandedTangentSpace -label " " -label1 (uiRes("m_createPrefWndUI.kLeftHanded")) -on1 "optionVar -intValue polyDefaultTangentSpace (2 + (`optionVar -q polyDefaultTangentSpace` % 2))" polyDefaultLeftHandedTangentSpace; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kDefaultTangentUVWinding")) -label1 (uiRes("m_createPrefWndUI.kDetect")) -on1 "int $v = `optionVar -q polyDefaultTangentSpace`; optionVar -intValue polyDefaultTangentSpace (0 + $v - ($v % 2))" polyDefaultTangentsDetectUVWindingOrder; radioButtonGrp -numberOfRadioButtons 1 -columnWidth 1 155 -scl polyDefaultTangentsDetectUVWindingOrder -label " " -label1 (uiRes("m_createPrefWndUI.kIgnore")) -on1 "int $v = `optionVar -q polyDefaultTangentSpace`; optionVar -intValue polyDefaultTangentSpace (1 + $v - ($v % 2))" polyDefaultTangentsIgnoreUVWindingOrder; checkBoxGrp -columnWidth 1 155 -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kUseTangentSpaceNormalsByDefault")) -annotation (uiRes("m_createPrefWndUI.kUseTangentSpaceNormalsByDefaultAnnot")) -changeCommand1 "toggleUseTangentSpaceNormalsByDefault" polyDefaultTangentSpaceNormals; floatSliderGrp -field true -columnWidth 1 155 -label (uiRes("m_createPrefWndUI.kTangentSpaceSmoothing")) -min 0 -max 180 -changeCommand "optionVar -floatValue polyDefaultTangentSmoothingAngle #1" polyDefaultTangentSmoothingAngle; setParent $parent; separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kQuadDrawKeyMappingSection")) ; columnLayout -adj true; // Don't use a separator in rowLayout to form a distance of "Presets:" label, // we use proper columnWidth and columnAttach to define the distance of 140. rowLayout -nc 2 -cw2 186 105 -cat 1 "right" 0 -cat 2 "left" 0 presetRow; text -label (uiRes("m_createPrefWndUI.kPresetLabel")) -parent presetRow; optionMenu -label "" -w 105 -changeCommand "changeQuadDrawPresetOM()" -parent presetRow MT_presetOM; menuItem -label (uiRes("m_createPrefWndUI.kDefaultMenu")); menuItem -label (uiRes("m_createPrefWndUI.kCustomMenu")); setParent ..; separator; rowLayout -nc 1 -cw1 240 -cat 1 "right" 0 onQuadMeshOffQuadMeshRow; text -label (uiRes("m_createPrefWndUI.kOnQMOffQMLabel")) -parent onQuadMeshOffQuadMeshRow; setParent ..; separator; rowLayout -nc 3 -cw3 140 155 357 -cat 1 "both" 0 -cal 1 "right" -cat 3 "left" 7 LMBRow; text -label (uiRes("m_createPrefWndUI.kLMBLabel")) -parent LMBRow; optionMenu -label "" -w 160 -cc "changeQuadDrawOM()" -parent LMBRow MT_LMBOM; menuItem -label (uiRes("m_createPrefWndUI.kTweakDropDots")); menuItem -label (uiRes("m_createPrefWndUI.kRelaxFillQuad")); menuItem -label (uiRes("m_createPrefWndUI.kInsertEdgeLoopLabel")); menuItem -label (uiRes("m_createPrefWndUI.kDeleteFaceOrEdgeLoop")); menuItem -label (uiRes("m_createPrefWndUI.kExtendPolyStrip")); optionMenu -e -sl `nexOpt -q qdNoModifierKeys` MT_LMBOM; rowLayout -nc 2 LMBRowLabels; text -label (uiRes("m_createPrefWndUI.kMMBLabel")) -parent LMBRowLabels; text -label (uiRes("m_createPrefWndUI.kTweakLabel")) -parent LMBRowLabels -en 0 MT_MMBText; setParent ..; setParent ..; rowLayout -nc 3 -cw3 140 155 357 -cat 1 "both" 0 -cal 1 "right" -cat 3 "left" 7 shiftPlusLMBRow; text -label (uiRes("m_createPrefWndUI.kShiftPlusLMBLabel")) -parent shiftPlusLMBRow; optionMenu -label "" -w 160 -cc "changeQuadDrawOM()" -parent shiftPlusLMBRow MT_shiftPlusLMBOM; menuItem -label (uiRes("m_createPrefWndUI.kTweakDropDots")); menuItem -label (uiRes("m_createPrefWndUI.kRelaxFillQuad")); menuItem -label (uiRes("m_createPrefWndUI.kInsertEdgeLoopLabel")); menuItem -label (uiRes("m_createPrefWndUI.kDeleteFaceOrEdgeLoop")); menuItem -label (uiRes("m_createPrefWndUI.kExtendPolyStrip")); optionMenu -e -sl `nexOpt -q qdShiftModifierKeys` MT_shiftPlusLMBOM; rowLayout -nc 2 shiftPlusLMBRowLabels; text -label (uiRes("m_createPrefWndUI.kShiftPlusMMBLabel")) -parent shiftPlusLMBRowLabels; text -label (uiRes("m_createPrefWndUI.kRelaxSelectionLabel")) -parent shiftPlusLMBRowLabels -en 0 MT_shiftPlusMMBText; setParent ..; setParent ..; rowLayout -nc 3 -cw3 140 155 357 -cat 1 "both" 0 -cal 1 "right" -cat 3 "left" 7 ctrlPlusLMBRow; text -label (uiRes("m_createPrefWndUI.kCtrlPlusLMBLabel")) -parent ctrlPlusLMBRow; optionMenu -label "" -w 160 -cc "changeQuadDrawOM()" -parent ctrlPlusLMBRow MT_ctrlPlusLMBOM; menuItem -label (uiRes("m_createPrefWndUI.kTweakDropDots")); menuItem -label (uiRes("m_createPrefWndUI.kRelaxFillQuad")); menuItem -label (uiRes("m_createPrefWndUI.kInsertEdgeLoopLabel")); menuItem -label (uiRes("m_createPrefWndUI.kDeleteFaceOrEdgeLoop")); menuItem -label (uiRes("m_createPrefWndUI.kExtendPolyStrip")); optionMenu -e -sl `nexOpt -q qdControlModifierKeys` MT_ctrlPlusLMBOM; rowLayout -nc 2 ctrlPlusLMBRowLabels; text -label (uiRes("m_createPrefWndUI.kCtrlPlusMMBLabel")) -parent ctrlPlusLMBRowLabels; text -label (uiRes("m_createPrefWndUI.kInsertEdgeLoopMidLabel")) -parent ctrlPlusLMBRowLabels -en 0 MT_ctrlPlusMMBText; setParent ..; setParent ..; rowLayout -nc 3 -cw3 140 155 357 -cat 1 "both" 0 -cal 1 "right" -cat 3 "left" 7 ctrlPlusShiftPlusLMBRow; text -label (uiRes("m_createPrefWndUI.kCtrlPlusShiftPlusLMBLabel")) -parent ctrlPlusShiftPlusLMBRow; optionMenu -label "" -w 160 -cc "changeQuadDrawOM()" -parent ctrlPlusShiftPlusLMBRow MT_ctrlPlusShiftPlusLMBOM; menuItem -label (uiRes("m_createPrefWndUI.kTweakDropDots")); menuItem -label (uiRes("m_createPrefWndUI.kRelaxFillQuad")); menuItem -label (uiRes("m_createPrefWndUI.kInsertEdgeLoopLabel")); menuItem -label (uiRes("m_createPrefWndUI.kDeleteFaceOrEdgeLoop")); menuItem -label (uiRes("m_createPrefWndUI.kExtendPolyStrip")); optionMenu -e -sl `nexOpt -q qdControlShiftModifierKeys` MT_ctrlPlusShiftPlusLMBOM; rowLayout -nc 2 ctrlPlusShiftPlusLMBRowLabels; text -label (uiRes("m_createPrefWndUI.kCtrlPlusShiftPlusMMBLabel")) -parent ctrlPlusShiftPlusLMBRowLabels; text -label (uiRes("m_createPrefWndUI.kMoveEdgeLoopLabel")) -parent ctrlPlusShiftPlusLMBRowLabels -en 0 MT_ctrlPlusShiftPlusMMBText; setParent ..; setParent ..; rowLayout -nc 3 -cw3 140 155 357 -cat 1 "both" 0 -cal 1 "right" -cat 3 "left" 7 tabPlusLMBRow; text -label (uiRes("m_createPrefWndUI.kTabPlusLMBLabel")) -parent tabPlusLMBRow; optionMenu -label "" -w 160 -cc "changeQuadDrawOM()" -parent tabPlusLMBRow MT_tabPlusLMBOM; menuItem -label (uiRes("m_createPrefWndUI.kTweakDropDots")); menuItem -label (uiRes("m_createPrefWndUI.kRelaxFillQuad")); menuItem -label (uiRes("m_createPrefWndUI.kInsertEdgeLoopLabel")); menuItem -label (uiRes("m_createPrefWndUI.kDeleteFaceOrEdgeLoop")); menuItem -label (uiRes("m_createPrefWndUI.kExtendPolyStrip")); optionMenu -e -sl `nexOpt -q qdTabModifierKeys` MT_tabPlusLMBOM; rowLayout -nc 2 tabPlusLMBRowLabels; text -label (uiRes("m_createPrefWndUI.kTabPlusMMBLabel")) -parent tabPlusLMBRowLabels; text -label (uiRes("m_createPrefWndUI.kExtendLoopLabel")) -parent tabPlusLMBRowLabels -en 0 MT_tabPlusMMBText; setParent ..; changeQuadDrawOM(); setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kThreeDeePaint")) ; columnLayout -adjustableColumn true; checkBoxGrp -columnWidth 1 155 -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_createPrefWndUI.kRenameTextures")) -annotation (uiRes("m_createPrefWndUI.kRenameTexturesAnnot")) -changeCommand1 "optionVar -intValue disableRenaming3dPaintTextures (!#1)" threeDeePaintRenameTextures; setParent $parent; setUITemplate -popTemplate; prefsUpdateModeling(); } global proc prefsCreateNodeEditorSync() { // Sync node editor shape optionVars from prefs window int $ix = `radioButtonGrp -q -sl nodeEdPrefShapesOMG`; if ($ix == 1) { optionVar -iv nodeEdShowShapes 1; optionVar -iv nodeEdShowSGShapes 1; } else if ($ix == 2) { optionVar -iv nodeEdShowShapes 1; optionVar -iv nodeEdShowSGShapes 0; } else { optionVar -iv nodeEdShowShapes 0; optionVar -iv nodeEdShowSGShapes 0; } $ix = `radioButtonGrp -q -sl nodeEdPrefViewModeRBG`; // radioButtonGrp selection is 1-4, which correspond to // view modes 0-3 optionVar -iv nodeEdDefaultNodeViewMode ($ix - 1); } global proc prefsCreateNodeEditor() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefNodeEditorCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kDisplayTitle")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kGrid")) -ann (uiRes("m_createPrefWndUI.kGridVisAnnot")) -cc1 "optionVar -iv nodeEdGridVisibility #1" nodeEdPrefDisplayG; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kGridSnapping")) -ann (uiRes("m_createPrefWndUI.kGridSnapAnnot")) -cc1 "optionVar -iv nodeEdGridSnapping #1" nodeEdPrefDisplayGS; radioButtonGrp -nrb 3 -vr -label (uiRes("m_createPrefWndUI.kShapes")) -ann (uiRes("m_createPrefWndUI.kShapesAnn")) -label1 (uiRes("m_nodeEditorPanel.kAllShapes")) -label2 (uiRes("m_nodeEditorPanel.kAllShapesExceptShadingGroupMembers")) -label3 (uiRes("m_nodeEditorPanel.kNoShapes")) -cc "prefsCreateNodeEditorSync" nodeEdPrefShapesOMG; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kTransforms")) -ann (uiRes("m_createPrefWndUI.kTransformsAnnot")) -cc1 "optionVar -iv nodeEdShowTransforms #1" nodeEdPrefDisplayT; checkBoxGrp -ncb 1 -label "" -ann (getRunTimeCommandAnnotation("NodeEditorExtendToShapes")) -label1 (uiRes("m_createPrefWndUI.kExtendToShapes")) -cc1 "optionVar -iv nodeEdExtendToShapes #1" nodeEdPrefDisplayETS; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kShowNamespace")) -ann (uiRes("m_createPrefWndUI.kShowNamespaceAnnot")) -cc1 "optionVar -iv nodeEdShowNamespace #1" nodeEdPrefDisplaySN; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kUseAssets")) -ann (uiRes("m_createPrefWndUI.kUseAssetsAnnot")) -cc1 "optionVar -iv nodeEdUseAssetsAndPublishedAttributes #1" nodeEdPrefDisplayUA; radioButtonGrp -nrb 4 -vr -label (uiRes("m_createPrefWndUI.kNodeViewMode")) -ann (uiRes("m_createPrefWndUI.kNodeViewModeAnnot")) -label1 (uiRes("m_nodeEditorPanel.kSimpleMode")) -label2 (uiRes("m_nodeEditorPanel.kConnectedMode")) -label3 (uiRes("m_nodeEditorPanel.kFullMode")) -label4 (uiRes("m_nodeEditorPanel.kCustomMode")) -cc "prefsCreateNodeEditorSync" nodeEdPrefViewModeRBG; setParent ..; // columnLayout setParent ..; // frameLayout frameLayout -label (uiRes("m_createPrefWndUI.kSyncNodeEditorTitle")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kOnSelection")) -ann (getRunTimeCommandAnnotation( "NodeEditorToggleSyncedSelection" )) -cc1 "optionVar -iv nodeEdSyncedSelection #1" nodeEdPrefUpdateOS; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kAddOnNodeCreate")) -ann (getRunTimeCommandAnnotation( "NodeEditorAddOnNodeCreate")) -cc1 "optionVar -iv nodeEdAddNewNodes #1" nodeEdPrefUpdateONC; setParent ..; // columnLayout setParent ..; // frameLayout setParent $parent; setUITemplate -popTemplate; prefsUpdateNodeEditor(); } global proc prefEvaluationModeChanged() { int $value = `optionMenuGrp -q -select evaluationModeMenuGrp`; //1. DG //2. EMS //3. EMP string $options = ""; switch( $value ) { case 1: $options = "-mode \"off\""; checkBoxGrp -e -en 0 gpuOverrideChkBx; checkBoxGrp -e -en 0 controllerPrePopCbx; evaluationManager -manipulation off; break; case 2: $options = "-mode serial"; checkBoxGrp -e -en 1 gpuOverrideChkBx; checkBoxGrp -e -en 1 controllerPrePopCbx; evaluationManager -manipulation on; break; case 3: checkBoxGrp -e -en 1 gpuOverrideChkBx; checkBoxGrp -e -en 1 controllerPrePopCbx; $options = "-mode parallel"; evaluationManager -manipulation on; break; } optionVar -iv evaluationMode $value; evalEcho( "evaluationManager " + $options); refresh; //update HUD if present } global proc prefsCreateKeys() { global string $gPreferenceWindow; global string $gPlayBackSlider; setParent $gPreferenceWindow; string $parent = "prefKeysCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kEvaluationTitle")) ; columnLayout -adj true; optionMenuGrp -label (uiRes("m_createPrefWndUI.kEvaluationMode")) -cc "prefEvaluationModeChanged; " evaluationModeMenuGrp; menuItem -label (uiRes("m_createPrefWndUI.kDGMode")) dgMode; menuItem -label (uiRes("m_createPrefWndUI.kEMSMode")) emsMode; menuItem -label (uiRes("m_createPrefWndUI.kEMPode")) empMode; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kGPUOverride")) -cc1 "optionVar -iv gpuOverride #1; if(#1) {turnOnOpenCLEvaluatorActive();} else {turnOffOpenCLEvaluatorActive(); }" gpuOverrideChkBx; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kControllerPrepopulate")) -cc1 "optionVar -iv prepopulateController #1;" controllerPrePopCbx; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kAutoKeyTitle")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kAutoKey")) -cc1 "autoKeyframe -state #1; optionMenuGrp -e -en #1 autoKeyCharacter" autoKey; optionMenuGrp -label (uiRes("m_createPrefWndUI.kOnCharacterSets")) -cc "prefAutoKeyCharacterChanged" autoKeyCharacter; menuItem -label (uiRes("m_createPrefWndUI.kKeyModifiedAttributes")) stardardCharAuto; menuItem -label (uiRes("m_createPrefWndUI.kKeyAllAttributes")) allCharAuto; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kRotationInterpolation")) ; columnLayout -adj true; optionMenuGrp -label (uiRes("m_createPrefWndUI.kNewCurveDefault")) -cc "optionVar -iv rotationInterpolationDefault `optionMenuGrp -query -select rotationInterpolationDefaultOptions`" rotationInterpolationDefaultOptions; menuItem -label (uiRes("m_createPrefWndUI.kIndependentEulerAngle")) rotationInterpolationDefaultNone; menuItem -label (uiRes("m_createPrefWndUI.kSynchronizedEulerAngle")) rotationInterpolationDefaultEuler; menuItem -label (uiRes("m_loadAnimMenuLibrary.kSyncQuatSlerp")) rotationInterpolationDefaultQuaternionSlerp; menuItem -label (uiRes("m_loadAnimMenuLibrary.kSyncQuatSquad")) rotationInterpolationDefaultQuaternionCubic; menuItem -label (uiRes("m_loadAnimMenuLibrary.kSyncQuat")) rotationInterpolationDefaultQuaternionTanDep; optionMenuGrp -label (uiRes("m_createPrefWndUI.kNewHIKCurveDefault")) -cc "optionVar -iv hikRotationInterpolationDefault `optionMenuGrp -query -select hikRotationInterpolationDefaultOptions`" hikRotationInterpolationDefaultOptions; menuItem -label (uiRes("m_createPrefWndUI.kIndependentEulerAngle")) hikRotationInterpolationDefaultNone; menuItem -label (uiRes("m_createPrefWndUI.kSynchronizedEulerAngle")) hikRotationInterpolationDefaultEuler; menuItem -label (uiRes("m_loadAnimMenuLibrary.kSyncQuatSlerp")) hikRotationInterpolationDefaultQuaternionSlerp; menuItem -label (uiRes("m_loadAnimMenuLibrary.kSyncQuatSquad")) hikRotationInterpolationDefaultQuaternionCubic; menuItem -label (uiRes("m_loadAnimMenuLibrary.kSyncQuat")) hikRotationInterpolationDefaultQuaternionTanDep; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kTangents")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -cw 2 200 -label "" -label1 (uiRes("m_createPrefWndUI.kWeightedTangents")) -cc1 "keyTangent -edit -global -weightedTangents #1" weightedTangents; string $spline = (uiRes("m_createPrefWndUI.kSpline")); string $linear = (uiRes("m_createPrefWndUI.kLinear")); string $clamped = (uiRes("m_createPrefWndUI.kClamped")); string $flat = (uiRes("m_createPrefWndUI.kFlat")); string $plateau = (uiRes("m_createPrefWndUI.kPlateau")); string $auto = (uiRes("m_createPrefWndUI.kAuto")); optionMenuGrp -label (uiRes("m_createPrefWndUI.kDefaultInTangent")) -cc "prefAnimTangentsChanged 1" inTangentType; menuItem -label $spline splineItt; menuItem -label $linear linearItt; menuItem -label $clamped ClampedItt; menuItem -label $flat flatItt; menuItem -label $plateau PlateauItt; menuItem -label $auto AutoItt; optionMenuGrp -label (uiRes("m_createPrefWndUI.kDefaultOutTangent")) -cc "prefAnimTangentsChanged 0" outTangentType; menuItem -label $spline splineOtt; menuItem -label $linear linearOtt; menuItem -label $clamped ClampedOtt; menuItem -label $flat flatOtt; menuItem -label (uiRes("m_createPrefWndUI.kStepped")) steppedOtt; menuItem -label $plateau PlateauOtt; menuItem -label $auto AutoOtt; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kAnimationBlending")) ; columnLayout -adj true; radioButtonGrp -numberOfRadioButtons 1 -cw 2 250 -label (uiRes("m_createPrefWndUI.kBlend")) -label1 (uiRes("m_createPrefWndUI.kAlwaysBlend")) -on1 "optionVar -intValue animBlendingOpt 1" -annotation (uiRes("m_createPrefWndUI.kWhenKeyingAnObjectAnnot")) alwaysBlendOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 250 -scl alwaysBlendOpt -label "" -label1 (uiRes("m_createPrefWndUI.kBlendWithAll")) -on1 "optionVar -intValue animBlendingOpt 2" -annotation (uiRes("m_createPrefWndUI.kDoNotAllowConstrainedAnnot")) blendExceptConstraintsOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 250 -scl alwaysBlendOpt -label "" -label1 (uiRes("m_createPrefWndUI.kNeverBlend")) -annotation (uiRes("m_createPrefWndUI.kDoNotAllowBlendingAnnot")) -on1 "optionVar -intValue animBlendingOpt 0" neverBlendOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 250 -label (uiRes("m_createPrefWndUI.kAnimBlendBrokenInput")) -label1 (uiRes("m_createPrefWndUI.kAnimBlendToCurrentValue")) -on1 "optionVar -intValue animBlendBrokenInputOpt 1" -annotation (uiRes("m_createPrefWndUI.kAnimBlendToCurrentValueAnnot")) animBlendToCurrentValueOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 250 -scl animBlendToCurrentValueOpt -label "" -label1 (uiRes("m_createPrefWndUI.kAnimBlendToIdentity")) -on1 "optionVar -intValue animBlendBrokenInputOpt 2" -annotation (uiRes("m_createPrefWndUI.kAnimBlendToIdentityAnnot")) animBlendToIdentityOpt; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kGraphEditor")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -cw2 140 300 -label "" -label1 (uiRes("m_createPrefWndUI.kGraphEdSnapToAdjacentValues")) -cc "optionVar -intValue \"graphEdSnapToAdjacentValues\" #1" graphEdSnapToAdjacentValuesChk; checkBoxGrp -ncb 1 -cw2 140 300 -label "" -label1 (uiRes("m_createPrefWndUI.kGraphEdLMBMovesSelections")) -cc "optionVar -intValue \"graphEdLmbMovesSelections\" #1" graphEdLmbMovesSelectionsChk; floatFieldGrp -label (uiRes("m_createPrefWndUI.kSpacing")) -cc "optionVar -fv \"stackedCurvesSpace\" #1; animCurveEditor -e -stackedCurvesSpace #1 graphEditor1GraphEd;" graphEdStackedViewSpace; checkBoxGrp -ncb 1 -cw2 140 300 -label "" -label1 (uiRes("m_createPrefWndUI.kAutoFrame")) -annotation (uiRes("m_createPrefWndUI.kAutoFrameAnnot")) -cc "optionVar -intValue \"graphEditorAutoFit\" #1;" graphEdAutoFrameChk; checkBoxGrp -ncb 1 -cw2 140 300 -label "" -label1 (uiRes("m_createPrefWndUI.kAutoFrameTime")) -annotation (uiRes("m_createPrefWndUI.kAutoFrameTimeAnnot")) -cc "optionVar -intValue \"graphEditorAutoFitTime\" #1" graphEdAutoFrameTimeChk; // now that graphEdAutoFrameTimeChk exists, edit the command for graphEdAutoFrameChk checkBoxGrp -e -cc "optionVar -intValue \"graphEditorAutoFit\" #1; checkBoxGrp -e -en #1 \"graphEdAutoFrameTimeChk\";" graphEdAutoFrameChk; rowLayout -nc 2 -cw 1 350 -cal 1 "left" -cal 2 "right"; radioButtonGrp -numberOfRadioButtons 2 -label (uiRes("m_createPrefWndUI.kGraphEditorUI")) -label1 (uiRes("m_createPrefWndUI.kGraphEditorClassicUI")) -label2 (uiRes("m_createPrefWndUI.kGraphEditorNewUIGPU")) -on1 "optionVar -intValue graphEditorUI 1" -on2 "optionVar -intValue graphEditorUI 0" -annotation1 (uiRes("m_createPrefWndUI.kGraphEditorClassicUIAnnot")) -annotation3 (uiRes("m_createPrefWndUI.kGraphEditorNewUIGPUAnnot")) graphEditorUI; text -label (uiRes("m_createPrefWndUI.kGraphEditorClassicUINote")); setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kTimeEditor")) ; columnLayout -adj true; rowLayout -nc 4 -cw 1 140 -cat 1 "both" 0 -cal 1 "right" ; text -label (uiRes("m_createPrefWndUI.kTimeEditorGranularity")); intField -v 10 -minValue 1 -cc "prefTimeEditorGranularityChanged(#1)" timeEditorGranularity; setParent ..; rowLayout -nc 4 -cw 1 140 -cat 1 "both" 0 -cal 1 "right" ; text -label (uiRes("m_createPrefWndUI.kTimeEditorSnapTolerance")); intField -v 5 -minValue 1 -maxValue 40 -cc "prefTimeEditorSnapToleranceChanged(#1)" timeEditorSnapTolerance; setParent ..; rowLayout -nc 4 -cw 1 140 -cat 1 "both" 0 -cal 1 "right" ; text -label (uiRes("m_createPrefWndUI.kTimeEditorMinimumClipWidth")); intField -v 8 -minValue 1 -maxValue 100 -cc "prefTimeEditorMinimumClipWidthChanged(#1)" timeEditorMinimumClipWidth; setParent ..; checkBoxGrp -ncb 1 -cw2 140 300 -label "" -label1 (uiRes("m_createPrefWndUI.kTimeEditorHUD")) -annotation (uiRes("m_createPrefWndUI.kTimeEditorHUDAnnot")) -cc "optionVar -intValue \"timeEditorHUD\" #1" timeEditorHUDChk; checkBoxGrp -ncb 1 -cw2 140 300 -label "" -label1 (uiRes("m_createPrefWndUI.kTimeEditorAllowConstraintsOverride")) -cc "optionVar -intValue \"timeEditorAllowConstraintsOverride\" #1" timeEditorAllowConstraintsOverrideChk; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kGuideLines")) ; columnLayout -adj true; rowLayout -nc 4 -cw 1 140 -cat 1 "both" 0 -cal 1 "right" cadenceLineRow; text -label (uiRes("m_createPrefWndUI.kGraphEdCadenceLine")) ; optionMenu -cc "prefAnimEdCadenceLineChanged" animEdCadenceLineType; menuItem -label (uiRes("m_createPrefWndUI.kCadenceWorkingUnits")); // menu 1 menuItem -label (uiRes("m_createPrefWndUI.kCadenceCustom")); // menu 2 floatField -enable 0 -minValue 0.0 -precision 3 -tze false -cc "optionVar -floatValue \"animEdCadenceLineFreq\" #1" animEdCadenceLineFreq; text -label (uiRes("m_createPrefWndUI.kGraphEdCadenceLineFreq")) ; setParent ..; optionMenuGrp -label (uiRes("m_createPrefWndUI.kGraphEdValueLineDisplay")) -cc "prefGraphEdValueLineDisplayChanged" graphEdValueLineDisplayOpts; menuItem -label (uiRes("m_createPrefWndUI.kLinesOn")); // menu 1 menuItem -label (uiRes("m_createPrefWndUI.kLinesOff")); // menu 2 floatFieldGrp -label (uiRes("m_createPrefWndUI.kGraphEdValueLineInterval")) -precision 1 -tze false -cc "prefGraphEdValueLineIntervalChanged(#1)" graphEdValueLineInterval; intFieldGrp -label (uiRes("m_createPrefWndUI.kGraphEdValueMinLines")) -cc "prefGraphEdValueMinLinesChanged(#1)" graphEdValueMinLines; // TEMPORARILY DISABLING THE SHORT LINES FEATURE setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kSequencer")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -cw 2 300 -label (uiRes("m_createPrefWndUI.kShotDoubleClick")) -label1 (uiRes("m_createPrefWndUI.kSeqSetMayaRange")) -cc "optionVar -intValue seqDoubleClickMayaFrameRange #1" seqMayaFrameRangeChk; checkBoxGrp -ncb 1 -label " " -cw 2 300 -label1 (uiRes("m_createPrefWndUI.kSeqSelectCamera")) -cc "optionVar -intValue seqDoubleClickSelectCamera #1" seqSelectCamChk; checkBoxGrp -ncb 1 -label " " -cw 2 300 -label1 (uiRes("m_createPrefWndUI.kSeqFrameShot")) -cc "optionVar -intValue seqDoubleClickFrameShot #1" seqFrameShotChk; checkBoxGrp -ncb 1 -label " " -cw 2 300 -label1 (uiRes("m_createPrefWndUI.kSeqSoloTrack")) -cc "optionVar -intValue seqDoubleClickSoloTrack #1" seqSoloTrackChk; radioButtonGrp -numberOfRadioButtons 1 -cw 2 300 -label "" -label1 (uiRes("m_createPrefWndUI.kSeqSetSeqTime")) -on1 "optionVar -intValue seqDoubleClickSetSequenceTime 0" -annotation (uiRes("m_createPrefWndUI.kSeqSetSeqTimeAnnot")) sequenceTimeOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 300 -scl sequenceTimeOpt -label "" -label1 (uiRes("m_createPrefWndUI.kSeqSetSeqTimeCursor")) -on1 "optionVar -intValue seqDoubleClickSetSequenceTime 1" -annotation (uiRes("m_createPrefWndUI.kSeqSetSeqTimeCursorAnnot")) sequenceTimeCursorOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 300 -scl sequenceTimeOpt -label "" -label1 (uiRes("m_createPrefWndUI.kSeqSetSeqTimeShot")) -on1 "optionVar -intValue seqDoubleClickSetSequenceTime 2" -annotation (uiRes("m_createPrefWndUI.kSeqSetSeqTimeShotAnnot")) sequenceTimeShotStartOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 300 -label "" -label1 (uiRes("m_createPrefWndUI.kSeqSetTRShot")) -on1 "optionVar -intValue seqDoubleClickSetTimeRange 1" -annotation (uiRes("m_createPrefWndUI.kSeqSetTRShotAnnot")) sequenceTRShotOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 300 -scl sequenceTRShotOpt -label "" -label1 (uiRes("m_createPrefWndUI.kSeqSetTRSequencer")) -on1 "optionVar -intValue seqDoubleClickSetTimeRange 2" -annotation (uiRes("m_createPrefWndUI.kSeqSetTRSeqAnnot")) sequenceTRSeqOpt; radioButtonGrp -numberOfRadioButtons 1 -cw 2 300 -scl sequenceTRShotOpt -label "" -label1 (uiRes("m_createPrefWndUI.kSeqSetTRDoNothing")) -on1 "optionVar -intValue seqDoubleClickSetTimeRange 3" -annotation (uiRes("m_createPrefWndUI.kSeqSetTRDoNothingAnnot")) sequenceTRDoNothningOpt; setParent $parent; setUITemplate -popTemplate; prefsUpdateKeys(); prefAnimEdCadenceLineChanged(); } global proc prefsCreateFileReferences() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefFileReferencesCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kFileReferences")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -cw2 140 300 -label "" -label1 (uiRes("m_createPrefWndUI.kRefAnimCurvesEdit")) -cc1 "animDisplay -edit -refAnimCurvesEditable #1" refAnimCurvesEditableChk; checkBoxGrp -ncb 1 -cw2 140 300 -label "" -label1 (uiRes("m_createPrefWndUI.kRefLockEditable")) -cc1 "optionVar -iv refLockEditable #1" refLockEditableChk; setParent $parent; setUITemplate -popTemplate; prefsUpdateFileReferences(); } global proc prefsCreateSelect() { global string $gSelItems[]; global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefSelectCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kModifiers")) ; columnLayout -adj true; string $clickDrag = (uiRes("m_createPrefWndUI.kClickDragSelect")); checkBoxGrp -ncb 2 -label "" -labelArray2 (uiRes("m_createPrefWndUI.kSingleMarquee")) $clickDrag -cc1 "selectPref -singleBoxSelection #1" -cc2 "selectPref -clickDrag #1" -cw3 20 200 160 modsCBG1; string $pickChooser = (uiRes("m_createPrefWndUI.kPickChooser")); checkBoxGrp -ncb 2 -label "" -labelArray2 (uiRes("m_createPrefWndUI.kAffectsActive")) $pickChooser -cc1 "selectPref -affectsActive #1" -cc2 "selectPref -popupMenuSelection #1" -cw3 20 200 160 modsCBG2; string $expandPopup = (uiRes("m_createPrefWndUI.kExpandPopup")); checkBoxGrp -ncb 2 -label "" -labelArray2 (uiRes("m_createPrefWndUI.kIgnorePriority")) $expandPopup -cc1 "selectPref -ignoreSelectionPriority #1" -cc2 "selectPref -expandPopupList #1" -cw3 20 200 160 modsCBG3; string $disablePC = (uiRes("m_createPrefWndUI.kDisablePickChooser")); checkBoxGrp -ncb 2 -label "" -labelArray2 (uiRes("m_createPrefWndUI.kPreSelectHilite")) $disablePC -cc1 "selectPref -preSelectHilite #1" -cc2 "selectPref -disableComponentPopups #1" -cw3 20 200 240 modsCBG4; string $useDepth = (uiRes("m_createPrefWndUI.kDepthSelect")); string $autoUseDepth = (uiRes("m_createPrefWndUI.kAutoDepthSelect")); checkBoxGrp -ncb 2 -labelArray2 $autoUseDepth $useDepth -label "" -cc1 "selectPref -autoUseDepth #1; checkBoxGrp -e -enable2 (!#1) modsCBG5;" -cc2 "selectPref -useDepth #1" -cw3 20 200 240 modsCBG5; checkBoxGrp -ncb 2 -labelArray2 (uiRes("m_createPrefWndUI.kAssetCentricSelection")) (uiRes("m_createPrefWndUI.kAutoSelectContainer")) -label "" -cc1 "selectPref -containerCentricSelection #1;" -cc2 "selectPref -autoSelectContainer #1" -cw3 20 200 160 modsCBG6; string $trackSelectionOrder = (uiRes("m_createPrefWndUI.kTrackSelectionOrder")); checkBoxGrp -ncb 2 -labelArray2 $trackSelectionOrder (uiRes("m_createPrefWndUI.kSwitchCompSelOnTypeChange")) -label "" -cc1 "selectPref -trackSelectionOrder #1" -cc2 "selectPref -selectTypeChangeAffectsActive #1" -cw3 20 200 240 modsCBG7; string $clearChannelSelection = (uiRes("m_createPrefWndUI.kResetSelectedChannels")); checkBoxGrp -ncb 1 -label "" -label1 $clearChannelSelection -cc1 "optionVar -intValue \"ChannelBox_ClearSelectionOnObjectSelectionChange\" #1" -cw2 20 200 modsCBG8; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kClickBoxSize")) -min 0 -max 100 -fmx 100 -cc "selectPref -clickBoxSize #1" -cw 1 120 clickBoxSizeS; intSliderGrp -label (uiRes("m_createPrefWndUI.kPreSelectSize")) -field true -minValue 0 -maxValue 250 -fieldMinValue 0 -fieldMaxValue 250 -cc "selectPref -preSelectSize #1" -cw 1 120 -annotation (uiRes("m_createPrefWndUI.kPreSelectSizeAnnot")) MT_preSelectSize_ISG; intSliderGrp -label (uiRes("m_createPrefWndUI.kSelectDeadSpaceRange")) -field true -minValue 0 -maxValue 250 -fieldMinValue 0 -fieldMaxValue 250 -cc "selectPref -preSelectDeadSpace #1" -cw 1 120 -annotation (uiRes("m_createPrefWndUI.kSelectDeadSpaceAnnot")) MT_selectDeadSpaceRange_ISG; intSliderGrp -label (uiRes("m_createPrefWndUI.kTweakDeadSpaceRange")) -field true -minValue 0 -maxValue 250 -fieldMinValue 0 -fieldMaxValue 250 -cc "selectPref -preSelectTweakDeadSpace #1" -cw 1 120 -annotation (uiRes("m_createPrefWndUI.kTweakDeadSpaceAnnot")) MT_tweakDeadSpaceRange_ISG; separator; optionMenuGrp -cw 1 160 -cw 2 160 -label (uiRes("m_createPrefWndUI.kSelectionChildHighlighting")) -cc "prefSelChildHighlightModeChanged" prefSelChildHighlightMode; menuItem -label (uiRes("m_createPrefWndUI.kAlwaysHighlight")); menuItem -label (uiRes("m_createPrefWndUI.kNeverHighlight")); menuItem -label (uiRes("m_createPrefWndUI.kUseObjectHighlight")); setParent $parent; if (`isTrue "PolygonsExists"`) { separator; frameLayout -label (uiRes("m_createPrefWndUI.kPolygonSelection")) ; columnLayout -adj true; string $wholeFace = (uiRes("m_createPrefWndUI.kWholeFace")); radioButtonGrp -numberOfRadioButtons 2 -label (uiRes("m_createPrefWndUI.kSelectFacesWith")) -label1 (uiRes("m_createPrefWndUI.kCenter")) -label2 $wholeFace -on1 "polySelectConstraint -wholeSensitive off" -on2 "polySelectConstraint -wholeSensitive on" polyFaceSensitiveRadio; setParent $parent; } separator; frameLayout -label (uiRes("m_createPrefWndUI.kPriorityTitle")) ; formLayout priorForm; textScrollList -h 130 -w 180 -ams true -sc "prefSelectPriorListChanged" priorList; // Add the selection priority items to the list in alphabetical order // int $i; string $sortedSelItems[] = `sort $gSelItems`; for ($i = 0; $i < size($sortedSelItems); $i++) { string $currItem = $sortedSelItems[$i]; textScrollList -e -width 205 -append `selectionItems_melToUI $sortedSelItems[$i]` priorList; } textScrollList -e -sii 1 priorList; optionMenuGrp -cw 1 60 -cw 2 150 -label (uiRes("m_createPrefWndUI.kPresets")) -cc "prefSelectPriorModeChanged" presetOpts; menuItem -label (uiRes("m_createPrefWndUI.kCustom")) ; menuItem -label (uiRes("m_createPrefWndUI.kAnimation")) ; menuItem -label (uiRes("m_createPrefWndUI.kNURBS")) ; menuItem -label (uiRes("m_createPrefWndUI.kRendering")) ; menuItem -label (uiRes("m_createPrefWndUI.kDynamicsMenu")) ; intFieldGrp -label (uiRes("m_createPrefWndUI.kPriority")) -cw 1 60 -cc "prefSelectPriorValChanged" priorVal; setParent ..; formLayout -e -af priorList "left" 10 -af priorList "top" 0 -af presetOpts "top" 0 -ac presetOpts "left" 25 priorList -ac priorVal "top" 75 presetOpts -ac priorVal "left" 25 priorList priorForm; setParent $parent; setUITemplate -popTemplate; prefsUpdateSelect(); } global proc prefsCreateSnap() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefSnapCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kSnapping")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kUseSnapTolerance")) -cc1 "snapMode -useTolerance #1" -cw 2 240 useSnapCBG1; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kSnapTolerance")) -min 0 -max 100 -fmx 100 -cc "snapMode -tolerance #1" snapToleranceSG; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kUVTextureEditorSnapping")) ; columnLayout -adj true; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kUVSnapTolerance")) -min 0 -max 100 -fmx 100 -cc "snapMode -uvTolerance #1" snapUVToleranceSG; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kEdgeSnapping")) ; columnLayout -adj true; intSliderGrp -field true -label (uiRes("m_createPrefWndUI.kSnapMagnets")) -min 0 -max 10 -fmx 100 -cc "snapMode -edgeMagnet #1" snapMagnetSG; floatSliderGrp -field true -label (uiRes("m_createPrefWndUI.kMagnetTolerance")) -min 0.0 -max 10.0 -fmx 100.0 -cc "snapMode -edgeMagnetTolerance #1" snapMagnetToleranceSG; setParent $parent; setUITemplate -popTemplate; prefsUpdateSnap(); } global proc prefsCreateSound() { global string $gPreferenceWindow; global string $gPlayBackSlider; setParent $gPreferenceWindow; string $parent = "prefSoundCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kSound")) ; columnLayout -adj true; string $bottom = (uiRes("m_createPrefWndUI.kBottom")); string $all = (uiRes("m_createPrefWndUI.kAllOption")); radioButtonGrp -nrb 3 -label (uiRes("m_createPrefWndUI.kWaveformDisplay")) -cw 2 100 -cw 3 100 -labelArray3 (uiRes("m_createPrefWndUI.kTop")) $bottom $all -on1 "timeControl -e -waveform top $gPlayBackSlider" -on2 "timeControl -e -waveform bottom $gPlayBackSlider" -on3 "timeControl -e -waveform both $gPlayBackSlider" soundDisplay; checkBoxGrp -label (uiRes("m_createPrefWndUI.kRepeatOnHold")) -ncb 1 -label1 "" -cc1 ( "rowLayout -e -enable #1 soundRepeatChunkLayout;" + "timeControl -e -repeatOnHold #1 $gPlayBackSlider;" ) soundRepeat; rowLayout -nc 6 -cw6 140 100 100 100 10 10 -cat 1 "both" 0 -cal 1 "right" -cal 2 "left" -cal 3 "left" -cal 4 "left" soundRepeatChunkLayout; text -label (uiRes("m_createPrefWndUI.kRepeatSize")) ; radioCollection soundRepeatChunkCollection; radioButton -label (uiRes("m_createPrefWndUI.kOne")) -onc "timeControl -e -repeatChunkSize 1 $gPlayBackSlider" soundRepeatChunk1; radioButton -label (uiRes("m_createPrefWndUI.kTwo")) -onc "timeControl -e -repeatChunkSize 2 $gPlayBackSlider" soundRepeatChunk2; radioButton -label (uiRes("m_createPrefWndUI.kThree")) -onc "timeControl -e -repeatChunkSize 3 $gPlayBackSlider" soundRepeatChunk3; // This is the radio button that gets set // when the timeControl's repeat chunk size // isn't 1, 2, or 3. It's invisible, so we // can get around the fact that one radio // button in a collection MUST always be // selected. // radioButton -label (uiRes("m_createPrefWndUI.kFour")) -visible false soundRepeatChunk4; floatField -visible false soundRepeatChunkValue; setParent $parent; setUITemplate -popTemplate; prefsUpdateSound(); } // ADSK_CLR_MGT_BEGIN source "colorManagementUtilities.mel"; source "colorSpaceProcedures.mel"; // // Change command callbacks // // Change command callback for the color management enabled check box global proc onColorMgtEnabledCheckBoxChange() { int $colorMgtEnabled = `checkBoxGrp -query -value1 colorManagementEnableCheckBox`; colorManagementPrefs -edit -popupOnError true -cmEnabled $colorMgtEnabled; } // Change command callback for the config file enabled check box global proc onColorMgtConfigFileEnableCheckBoxChange() { int $configFileEnabled = `checkBoxGrp -query -value1 colorManagementEnableConfigurationFileCheckBox`; changeColorMgtPrefsConfigFileEnable($configFileEnabled); } // Change command callback for the config file rules enabled check box global proc onColorMgtOCIORulesEnabledCheckBoxChange() { int $ocioRulesEnabled = `checkBoxGrp -query -value2 colorManagementEnableConfigurationFileCheckBox`; colorManagementPrefs -edit -ocioRulesEnabled $ocioRulesEnabled; } // Change command callback for the config file path text field with no argument global proc onColorMgtConfigFilePathTextFieldChange() { string $configFilePath = `textField -query -text colorManagementConfigPathTextField`; changeColorMgtPrefsConfigFilePath($configFilePath); } // Change command callback for the user transform path text field with no argument global proc onColorMgtUserTransformPathTextFieldChange() { string $userTransformPath = `textField -query -text colorManagementUserTransformPathTextField`; changeColorMgtPrefsUserTransformPath($userTransformPath); } // Command callback for browsing for a config file path global proc onColorMgtConfigPathBrowse() { string $configPath = `colorManagementPrefs -query -configFilePath`; string $path = browseConfigFilePathDialog($configPath); changeColorMgtPrefsConfigFilePath($path); } // Command callback for browsing for a user transform path global proc onColorMgtUserTransformPathBrowse() { string $userTransformPath = browseUserTransformPathDialog(); changeColorMgtPrefsUserTransformPath($userTransformPath); } // Engine procedure for all color management option menu change commands. global proc onColorMgtTransformOptionMenuChange( string $menu, string $type, string $cancelProc, string $flag ) { // Last entry is special: add custom transform. int $selection = `optionMenuGrp -query -select $menu`; if ($selection == `optionMenuGrp -query -numberOfItems $menu`) { // MEL python command only returns a result for a single-statement // string, so break up our Python calls. python("import maya\n"); string $pythonCmd = ("maya.app.colorMgt.customTransformUI.addCustomTransformDialog('" + $type + "')\n"); string $returnVal = python($pythonCmd); // If user cancelled out, restore menu selection. if ($returnVal == "") { eval $cancelProc; } return; } // Not the last entry: standard processing. string $name = `optionMenuGrp -query -value $menu`; eval ("colorManagementPrefs -edit -popupOnError true -" + $flag + " \"" + $name + "\""); } // Change command callback for the rendering space option menu global proc onColorMgtRenderingSpaceOptionMenuChange() { onColorMgtTransformOptionMenuChange( "colorManagementRenderingSpaceOptionMenu", "rendering space", "onColorMgtRenderingSpaceChanged", "renderingSpaceName" ); } // Change command callback for the view transform option menu global proc onColorMgtPrefsViewTransformOptionMenuChange() { onColorMgtTransformOptionMenuChange( "colorManagementViewTransformOptionMenu", "view", "onColorMgtPrefsViewTransformChanged", "viewTransformName" ); } // Remove user transform. global proc colorMgtRemoveTransform(string $transformName, string $type) { string $yes = (uiRes("m_createPrefWndUI.kYes")); string $no = (uiRes("m_createPrefWndUI.kNo")); string $confirmMsg = `format -stringArg $transformName (uiRes("m_createPrefWndUI.kColorMgtRemoveMsg"))`; string $answer = `confirmDialog -title (uiRes("m_createPrefWndUI.kColorMgtRemoveTransformTitle")) -button $yes -button $no -defaultButton $yes -cancelButton $no -dismissString $no -message $confirmMsg`; if ($answer == $yes) { colorManagementCatalog -removeTransform $transformName -type $type; colorManagementPrefsHoldCurrentState("save"); $fileName = eval("colorManagementPrefs -query -policyFileName"); if($fileName != "" ) { if(catch(`colorManagementPrefs -exportPolicy $fileName`)) { return; } } } } // Command callback to remove user transform. global proc onColorMgtRemoveTransform(string $flag, string $type) { // Transform must be evaluated dynamically, at time of remove transform, // so we query it here. string $cmd = "colorManagementPrefs -query -" + $flag; if ($type == "playblastOutput") { $cmd += " -outputTarget \"playblast\""; } else if ($type == "output") { $cmd += " -outputTarget \"renderer\""; } string $transformName = eval($cmd); colorMgtRemoveTransform($transformName, $type); } // // Script job callbacks // // Helper function to update the config file controls. proc onOCIOChanged() { int $configFileEnabled = `colorManagementPrefs -q -cmEnabled`; // Only enable the configFileEnabled checkbox if the config file // path is non-empty. if ($configFileEnabled) { string $configFilePath = `colorManagementPrefs -q -configFilePath`; if (size($configFilePath) == 0) { $configFileEnabled = false; } } if (`control -exists colorManagementEnableConfigurationFileCheckBox`) { control -edit -enable $configFileEnabled colorManagementEnableConfigurationFileCheckBox; } updateColorMgtPrefsOptionMenus(); } // Procedure to enable/disable the color management widgets based on the selection // of the "Enable Color Management" checkbox. // global proc enableColorMgtPrefsWidgets() { int $cmEnabled = `colorManagementPrefs -q -cmEnabled`; if (`control -exists colorManagementEnableCheckBox`) { checkBoxGrp -edit -value1 $cmEnabled colorManagementEnableCheckBox; } // UI color management controls to enable / disable. string $cmControls[] = { "colorManagementConfigPathMenus", "colorTransformPreferences", "inputColorSpacePreferences", "inputColorSpaceRules", "outputColorTransformPreferences", "colorManagementUserTransformPreferences", "colorManagementUserTransformPathMenus" }; if (colorManagementPolicyLocked()) { $cmControls[size($cmControls)] = "colorManagementPolicySettings"; disableColorMgtControls($cmControls); // It seems the function disableColorMgtControls cannot disable // the control colorManagementEnableConfigurationFileCheckBox. // So use the following code to disable it. if (`control -exists colorManagementEnableConfigurationFileCheckBox`) { checkBoxGrp -e -editable 0 colorManagementEnableConfigurationFileCheckBox; } } else { $cmControls[size($cmControls)] = "colorManagementUISettings"; enableColorMgtControls($cmControls); if (`control -exists colorManagementOutputEnableCheckBox`) { string $renderer = currentRenderer(); int $rendererSupportColorManagement = $cmEnabled && `renderer -q -supportColorManagement $renderer`; control -edit -enable $rendererSupportColorManagement colorManagementOutputEnableCheckBox; string $menuParent = `optionMenuGrp -query -parent colorManagementOutputTransformOptionMenu`; control -edit -enable $rendererSupportColorManagement $menuParent; } } onOCIOChanged(); } // scriptJob callback executed when the color management enabled has changed. global proc onColorMgtEnabledChanged() { enableColorMgtPrefsWidgets(); } // scriptJob callback executed when the config status or file path have changed, // and when preferences globally changed (e.g policy loaded) global proc onColorMgtChanged() { if (`control -exists colorManagementEnableConfigurationFileCheckBox`) { int $configFileEnabled = `colorManagementPrefs -q -cmConfigFileEnabled`; checkBoxGrp -edit -value1 $configFileEnabled colorManagementEnableConfigurationFileCheckBox; } if (`control -exists colorManagementConfigPathTextField`) { string $configFilePath = `colorManagementPrefs -q -configFilePath`; textField -e -text $configFilePath colorManagementConfigPathTextField; } onColorMgtEnabledChanged(); if (`control -exists colorManagementOutputEnableCheckBox`) { // Update output transform enable. int $outputEnabled = `colorManagementPrefs -q -outputTransformEnabled`; checkBoxGrp -e -value1 $outputEnabled colorManagementOutputEnableCheckBox; } if (`control -exists colorManagementUserTransformPathTextField`) { // Update user transform directory path. string $userTransformPath = `colorManagementCatalog -queryUserTransformPath`; textField -edit -text $userTransformPath colorManagementUserTransformPathTextField; } } // scriptJob callback executed when the config file enabled has changed. global proc onColorMgtConfigFileEnabledChanged() { if (`control -exists colorManagementEnableConfigurationFileCheckBox`) { int $configFileEnabled = `colorManagementPrefs -q -cmConfigFileEnabled`; checkBoxGrp -edit -value1 $configFileEnabled colorManagementEnableConfigurationFileCheckBox; } if (`control -exists colorManagementNoConfigPathWarningMenu`) { int $configEnabled = `colorManagementPrefs -q -cmConfigFileEnabled`; string $configFilePath = `colorManagementPrefs -q -configFilePath`; int $errorVisible = $configEnabled && !`file -q -exists $configFilePath`; rowLayout -e -visible $errorVisible colorManagementNoConfigPathWarningMenu; if ($errorVisible) { colorManagementPrefs -e -cmEnabled 0; } else { onOCIOChanged(); } } } // scriptJob callback executed when the config file path has changed. global proc onColorMgtConfigFilePathChanged() { if (`control -exists colorManagementConfigPathTextField`) { string $configFilePath = `colorManagementPrefs -q -configFilePath`; textField -e -text $configFilePath colorManagementConfigPathTextField; } // Try to enable the config file enabled control. onOCIOChanged(); } // scriptJob callback executed when the preferences rendering space has changed global proc onColorMgtRenderingSpaceChanged() { if (`control -exists colorManagementRenderingSpaceOptionMenu`) { string $wsName = `colorManagementPrefs -q -renderingSpaceName`; optionMenuGrp -e -v $wsName colorManagementRenderingSpaceOptionMenu; } } // scriptJob callback executed when the preferences view transform has changed global proc onColorMgtPrefsViewTransformChanged() { if (`control -exists colorManagementViewTransformOptionMenu`) { string $vtName = `colorManagementPrefs -q -viewTransformName`; optionMenuGrp -e -v $vtName colorManagementViewTransformOptionMenu; } } // scriptJob callback executed when the color manage pots flag // and policy file name has changed. global proc onColorMgtUserPrefsChanged() { if (`control -exists colorManagementEnableConfigurationFileCheckBox`) { int $ocioRulesEnabled = `colorManagementPrefs -q -ocioRulesEnabled`; checkBoxGrp -edit -value2 $ocioRulesEnabled colorManagementEnableConfigurationFileCheckBox; } if (`control -exists colorManagedPotsEnableCheckBox`) { int $doPots = `colorManagementPrefs -q -colorManagePots`; checkBoxGrp -edit -value1 $doPots colorManagedPotsEnableCheckBox; } if(`control -exists CMPolicyFilePathText`) { string $policyFileName = `colorManagementPrefs -q -policyFileName`; textField -e -text $policyFileName CMPolicyFilePathText; } } // Callback executed when import policy global proc prefColorMgtPolicyLocationBrowser() { // Open Import Policy Dialog by giving value 1 to the function browsePolicyFilePathDialog. string $fileName = browsePolicyFilePathDialog(1); if ($fileName == "") { return; } string $fontStyle = catch( `colorManagementPrefs -loadPolicy $fileName` )? "obliqueLabelFont" : "plainLabelFont" ; textField -e -font $fontStyle -text $fileName CMPolicyFilePathText; colorManagementPrefs -edit -policyFileName $fileName; } // Callback executed when export policy global proc onColorMgtExportPolicy() { // Open Export Policy Dialog by giving value 0 to the function browsePolicyFilePathDialog. string $fileName = browsePolicyFilePathDialog(0); if ($fileName == "") { return; } string $fontStyle = catch( `colorManagementPrefs -exportPolicy $fileName` )? "obliqueLabelFont" : "plainLabelFont" ; textField -e -font $fontStyle -text $fileName CMPolicyFilePathText; colorManagementPrefs -edit -policyFileName $fileName; } global proc onColorMgtPolicyFileTextFieldChanged() { string $fontStyle = ""; string $fileName = `textField -q -text CMPolicyFilePathText`; if ($fileName == "") { // This means user does not want to use policy file. colorManagementPrefs -e -policyFileName $fileName; textField -e -font "plainLabelFont" -text $fileName CMPolicyFilePathText; return; } if (!`file -q -exists $fileName`) { string $error = (uiRes("m_createPrefWndUI.kPolicyFileDoesNotExists")); string $errorMessage = `format -s $fileName $error`; catch(`error $errorMessage`); $fontStyle = "obliqueLabelFont"; } else { // If fails, mark the label font style to oblique. $fontStyle = catch( `colorManagementPrefs -loadPolicy $fileName` )? "obliqueLabelFont" : "plainLabelFont" ; } textField -e -font $fontStyle -text $fileName CMPolicyFilePathText; } // User transform settings UI creation. global proc createColorUserTransformSettings( string $flag, string $type ) { string $cmd = "onColorMgtRemoveTransform " + $flag + " \"" + $type + "\""; // User transform operations not available in OCIO mode. int $nativeMode = !`colorManagementPrefs -q -cmConfigFileEnabled`; symbolButton -enable $nativeMode -image "colorTransformSettings.png" transformSettings; popupMenu -button 1 -parent transformSettings; menuItem -label (uiRes("m_createPrefWndUI.kColorManagementRemoveTransform")) -command $cmd; setParent -menu ..; } // FP Render Target Handlers // global proc changeFloatingPointRenderTargetFormatCM() { string $fp = `optionMenuGrp -q -value floatingPointRenderTargetMenuInTabCM`; int $enum = 1; if($fp == "R32G32B32A32_FLOAT") { $enum = 1; } else if($fp == "R32G32B32_FLOAT") { $enum = 2; } else if($fp == "R16G16B16A16_FLOAT") { $enum = 3; } setAttr hardwareRenderingGlobals.floatingPointRTFormat $enum; } global proc floatingPointRenderTargetFormatChangedCM() { int $nbItems = `optionMenuGrp -q -numberOfItems floatingPointRenderTargetMenuInTabCM`; if($nbItems > 0) { string $fmt = `getAttr -asString hardwareRenderingGlobals.floatingPointRTFormat`; optionMenuGrp -edit -value $fmt floatingPointRenderTargetMenuInTabCM; } } global proc onFloatingPointRenderTargetEnabledCheckboxChangeCM() { // Enable int $fpEnabled = `checkBoxGrp -query -value1 floatingPointRTEnableCM` ; setAttr hardwareRenderingGlobals.floatingPointRTEnable $fpEnabled; updateFloatingPointRenderTargetCM($fpEnabled); } global proc onFloatingPointRenderTargetAttributeChangeCM() { // Enable int $fpEnabled = `getAttr hardwareRenderingGlobals.floatingPointRTEnable`; checkBoxGrp -edit -value1 $fpEnabled floatingPointRTEnableCM; updateFloatingPointRenderTargetCM($fpEnabled); } global proc updateFloatingPointRenderTargetCM(int $fpEnabled) { optionMenuGrp -edit -enable $fpEnabled floatingPointRenderTargetMenuInTabCM; // Rebuild menu based on ogsRender command string $menuItems[] = `optionMenuGrp -q -ils floatingPointRenderTargetMenuInTabCM`; for ($item in $menuItems) { deleteUI -menuItem $item; } string $fpFormat; string $fpFormats[] = `ogsRender -q -availableFloatingPointTargetFormat`; if (size($fpFormats) > 0) { setParent -m "floatingPointRenderTargetMenuInTabCM|OptionMenu"; for ($fpFormat in $fpFormats) { menuItem -collection "floatingPointRenderTargetMenuInTabCM" -label $fpFormat; } setParent -m ..; // Set current selection floatingPointRenderTargetFormatChangedCM(); } else { warning (uiRes("m_createPrefWndUI.kColorMgtMissingFloatingPointRenderFormats")) ; } } // Engine procedure to create color transform option menu and associated // settings. proc createColorTransformMenu( string $menuName, string $menuLabel, string $menuChangeCmd, string $transformNames[], string $transformName, string $flag, string $type, int $enableCustomMenu ) { rowLayout -numberOfColumns 2; optionMenuGrp -columnWidth 1 130 -label $menuLabel -changeCommand $menuChangeCmd $menuName; // Populate and set the initial selection for the option menu updateOptionMenu($menuName, $transformNames, $transformName, $enableCustomMenu); createColorUserTransformSettings($flag, $type); setParent ..; } // // Create the color management preferences tab // global proc prefsCreateColorManagement() { global string $gPreferenceWindow; global string $gPlayBackSlider; setParent $gPreferenceWindow; string $parent = "prefColorManagementCol"; // Check to see if this has been created already. if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; // Starting the Color Management frame here frameLayout -marginWidth 10 -marginHeight 10 -label (uiRes("m_createPrefWndUI.kColorManagementPrefs")); // User control to enable/disable all of color management int $cmIsEnabled = `colorManagementPrefs -q -cmEnabled`; checkBoxGrp -numberOfCheckBoxes 1 -columnWidth2 20 300 -label "" -label1 (uiRes("m_createPrefWndUI.kEnableColorManagementUC")) -value1 $cmIsEnabled -changeCommand ("onColorMgtEnabledCheckBoxChange") colorManagementEnableCheckBox; scriptJob -parent $gPreferenceWindow -event "colorMgtEnabledChanged" onColorMgtEnabledChanged; // Enable/disable color management configuration file & file rules checkBoxGrp -numberOfCheckBoxes 2 -columnWidth3 20 300 300 -label "" -label1 (uiRes("m_createPrefWndUI.kEnableColorManagementConfigurationFile")) -value1 `colorManagementPrefs -q -cmConfigFileEnabled` -changeCommand1 "onColorMgtConfigFileEnableCheckBoxChange" -label2 (uiRes("m_createPrefWndUI.kEnableColorManagementOCIORulesEnabled")) -value2 `colorManagementPrefs -q -ocioRulesEnabled` -changeCommand2 "onColorMgtOCIORulesEnabledCheckBoxChange" colorManagementEnableConfigurationFileCheckBox; scriptJob -parent $gPreferenceWindow -event "colorMgtConfigFileEnableChanged" onColorMgtConfigFileEnabledChanged; // OCIO config file path rowLayout -enable $cmIsEnabled -numberOfColumns 4 -columnWidth 1 35 -columnWidth 3 300 -adjustableColumn 3 -columnAlign4 "left" "left" "left" "left" -columnAttach4 "both" "both" "both" "both" colorManagementConfigPathMenus; text -label ""; text -label (uiRes("m_createPrefWndUI.kColorManagementConfigFilePath")); string $cmConfigFilePath = `colorManagementPrefs -q -configFilePath`; textField -text $cmConfigFilePath -changeCommand "onColorMgtConfigFilePathTextFieldChange" colorManagementConfigPathTextField; scriptJob -parent $gPreferenceWindow -event "colorMgtConfigFilePathChanged" onColorMgtConfigFilePathChanged; symbolButton -image "navButtonBrowse.png" -command "onColorMgtConfigPathBrowse" colorManagementConfigPathBrowser; setParent ..; // Color management config path warning section. rowLayout -enable $cmIsEnabled -numberOfColumns 2 -columnWidth 1 35 -visible false colorManagementNoConfigPathWarningMenu; text -label ""; text -label (uiRes("m_createPrefWndUI.kColorManagementNoConfigPathWarning")) -font obliqueLabelFont; setParent ..; // Color transform preferences frame frameLayout -marginWidth 10 -marginHeight 10 -label (uiRes("m_createPrefWndUI.kColorTransformPrefs")) colorTransformPreferences; // Rendering space string $renderingSpaceNames[] = `colorManagementPrefs -q -renderingSpaceNames`; string $renderingSpaceName = `colorManagementPrefs -q -renderingSpaceName`; createColorTransformMenu( "colorManagementRenderingSpaceOptionMenu", (uiRes("m_createPrefWndUI.kColorMgtRenderingSpace")), "onColorMgtRenderingSpaceOptionMenuChange", $renderingSpaceNames, $renderingSpaceName, "renderingSpaceName", "rendering space", 0 ); scriptJob -parent $gPreferenceWindow -event "colorMgtWorkingSpaceChanged" onColorMgtRenderingSpaceChanged; // View Transform string $viewTransformNames[] = `colorManagementPrefs -q -viewTransformNames`; string $viewTransformName = `colorManagementPrefs -q -viewTransformName`; createColorTransformMenu( "colorManagementViewTransformOptionMenu", (uiRes("m_createPrefWndUI.kColorManagementViewTransform")), "onColorMgtPrefsViewTransformOptionMenuChange", $viewTransformNames, $viewTransformName, "viewTransformName", "view", 1 ); scriptJob -parent $gPreferenceWindow -event "colorMgtPrefsViewTransformChanged" onColorMgtPrefsViewTransformChanged; setParent ..; // Input Color Space Rules frame frameLayout -marginWidth 10 -marginHeight 10 -label (uiRes("m_createPrefWndUI.kInputColorSpaceRules")) inputColorSpaceRules; python("import maya.app.colorMgt.inputSpaceRulesUI"); python("maya.app.colorMgt.inputSpaceRulesUI.build()"); setParent ..; // Output transform frame frameLayout -marginWidth 10 -marginHeight 10 -label (uiRes("m_createPrefWndUI.kOutputTransformPrefs")) outputColorTransformPreferences; // Output transform for renderer createOutputTransformUI( "colorManagementOutputTransformOptionTypeMenu", "colorManagementOutputTransformOptionMenu", "colorManagementOutputEnableCheckBox", 0 ); // Output transform for playblast createOutputTransformUI( "colorManagementOutputTransformForPlayblastOptionTypeMenu", "colorManagementOutputTransformForPlayblastOptionMenu", "colorManagementOutputForPlayblastEnableCheckBox", 1 ); setParent ..; // Color management configuration or policy changes require update of entire color management UI. scriptJob -parent $gPreferenceWindow -event "colorMgtConfigChanged" onColorMgtChanged; scriptJob -parent $gPreferenceWindow -event "colorMgtPrefsReloaded" onColorMgtChanged; // Current renderer change requires update of entire color management UI. scriptJob -attributeChange "defaultRenderGlobals.currentRenderer" onColorMgtChanged; // Custom Transform directory frame frameLayout -marginWidth 10 -marginHeight 10 -label (uiRes("m_createPrefWndUI.kSharedPathPrefs")) colorManagementUserTransformPreferences; // Shared Path rowLayout -enable $cmIsEnabled -numberOfColumns 3 -columnWidth 2 300 -adjustableColumn 2 -columnAlign3 "left" "left" "left" -columnAttach3 "left" "both" "right" colorManagementUserTransformPathMenus; text -label (uiRes("m_createPrefWndUI.kColorManagementCustomTransformPath")); string $cmUserTransformPath = `colorManagementCatalog -queryUserTransformPath`; textField -text $cmUserTransformPath -changeCommand "onColorMgtUserTransformPathTextFieldChange" colorManagementUserTransformPathTextField; symbolButton -image "navButtonBrowse.png" -command "onColorMgtUserTransformPathBrowse" colorManagementUserTransformPathBrowser; setParent ..; setParent ..; // UI Settings frame frameLayout -marginWidth 10 -marginHeight 10 -label (uiRes("m_createPrefWndUI.kCMUISettings")) colorManagementUISettings; // Color managed pots int $doPots = `colorManagementPrefs -q -colorManagePots`; checkBoxGrp -numberOfCheckBoxes 1 -columnWidth2 20 300 -label "" -label1 (uiRes("m_createPrefWndUI.kEnableColorManagedPots")) -value1 $doPots -changeCommand ("colorManagementPrefs -edit -popupOnError true -colorManagePots #1") colorManagedPotsEnableCheckBox; setParent ..; string $defaultCMpolicyPath = `optionVar -q colorManagementPolicyFileName`; string $fontStyle = `file -q -exists $defaultCMpolicyPath` ? "plainLabelFont" : "obliqueLabelFont"; if ($defaultCMpolicyPath == "") { // empty string is legal, this means user does not want to use policy file. Correct string should get plan label font style. $fontStyle = "plainLabelFont"; } // create floating point RT frame $fprtEnabled = `getAttr hardwareRenderingGlobals.floatingPointRTEnable`; frameLayout -marginWidth 10 -marginHeight 10 -label (uiRes("m_createPrefWndUI.kFloatingPointRTOptions")) fprtOptionsCM; checkBoxGrp -numberOfCheckBoxes 1 -columnWidth2 20 300 -label "" -label1 (uiRes("m_createPrefWndUI.kFloatingPointRTEnabledCM")) -value1 $fprtEnabled -changeCommand "onFloatingPointRenderTargetEnabledCheckboxChangeCM" floatingPointRTEnableCM; scriptJob -p floatingPointRTEnableCM -attributeChange hardwareRenderingGlobals.floatingPointRTEnable "onFloatingPointRenderTargetAttributeChangeCM"; optionMenuGrp -label (uiRes("m_createPrefWndUI.kFloatingPointRTFormatCM")) -columnWidth2 80 240 -changeCommand "changeFloatingPointRenderTargetFormatCM" floatingPointRenderTargetMenuInTabCM; // script jobs for fp format scriptJob -p floatingPointRenderTargetMenuInTabCM -attributeChange hardwareRenderingGlobals.floatingPointRTFormat "floatingPointRenderTargetFormatChangedCM"; updateFloatingPointRenderTargetCM($fprtEnabled); setParent ..; frameLayout -marginWidth 10 -marginHeight 10 -label (uiRes("m_createPrefWndUI.kCMExportPolicy")) colorManagementPolicySettings; rowLayout -numberOfColumns 3 -columnWidth 1 118 -adjustableColumn 2; // Color export policy button -label (uiRes("m_createPrefWndUI.kExportPolicyButton")) -command "onColorMgtExportPolicy"; textField -font $fontStyle -text $defaultCMpolicyPath -cc ("onColorMgtPolicyFileTextFieldChanged") CMPolicyFilePathText; symbolButton -image "navButtonBrowse.png" -c "prefColorMgtPolicyLocationBrowser" CMBrowseBtn; setParent ..; setParent ..; rowLayout -numberOfColumns 2 -adjustableColumn 1 -columnAlign2 "right" "right" -columnWidth2 40 15; text (uiRes("m_createPrefWndUI.kColorManagementPrefsHelp")); symbolButton -i "help.png" -command "showHelp ColorManagementPreferences" colorManagementPreferencesHelpButton; setParent ..; // Even if there are several user preferences, only one trigger is needed because // the attached method updates all user preferences. scriptJob -parent $gPreferenceWindow -event "colorMgtUserPrefsChanged" onColorMgtUserPrefsChanged; // Update the enable state of the color management widgets. enableColorMgtPrefsWidgets(); setParent $parent; setUITemplate -popTemplate; } // ADSK_CLR_MGT_END global proc prefsCreateKin() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefKinCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kInverseKinematics")) ; columnLayout -adj true; floatSliderGrp -label (uiRes("m_createPrefWndUI.kJointSize")) -field 1 -min 0.01 -max 5.0 -pre 2 -dc "jointDisplayScale #1" -cc "jointDisplayScale #1" jdsPrefWidget; floatSliderGrp -label (uiRes("m_createPrefWndUI.kIkJointSize")) -field 1 -min 0.01 -max 5.0 -pre 2 -dc "jointDisplayScale -ikfk #1" -cc "jointDisplayScale -ikfk #1" jdsIkFkPrefWidget; floatSliderGrp -label (uiRes("m_createPrefWndUI.kIKHandleSize")) -field 1 -min 0.01 -max 5.0 -pre 2 -dc "ikHandleDisplayScale #1" -cc "ikHandleDisplayScale #1" hdsPrefWidget; string $ik = (uiRes("m_createPrefWndUI.kIk")); string $fk = (uiRes("m_createPrefWndUI.kFk")); string $both = (uiRes("m_createPrefWndUI.kBoth")); radioButtonGrp -nrb 4 -label (uiRes("m_createPrefWndUI.kIkBlendingDisplay")) -cw 2 68 -cw 3 68 -cw 4 68 -cw 5 68 -labelArray4 (uiRes("m_createPrefWndUI.kNoneSelection")) $ik $fk $both -on1 "ikfkDisplayMethod -display none" -on2 "ikfkDisplayMethod -display ik" -on3 "ikfkDisplayMethod -display fk" -on4 "ikfkDisplayMethod -display ikfk" ikfkDisplay; setParent $parent; setUITemplate -popTemplate; prefsUpdateKin(); } global proc prefsCreateAnimDisplay() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefAnimDispCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kGhosts")) ; columnLayout -adj true; intSliderGrp -field true -cw3 175 75 150 -label (uiRes("m_createPrefWndUI.kStepsBeforeCurrentFrame")) -annotation (uiRes("m_createPrefWndUI.kNumberOfGhostsLessAnnot")) -min 0 -max 10 -fmx 100 -cc "updateGhostData 0 #1" ghostFramesBeforeSlider; intSliderGrp -field true -cw3 175 75 150 -label (uiRes("m_createPrefWndUI.kStepsAfterCurrentFrame")) -annotation (uiRes("m_createPrefWndUI.kNumberOfGhostsGreaterAnnot")) -min 0 -max 10 -fmx 100 -cc "updateGhostData 1 #1" ghostFramesAfterSlider; intSliderGrp -field true -cw3 175 75 150 -label (uiRes("m_createPrefWndUI.kFramesPerStep")) -annotation (uiRes("m_createPrefWndUI.kTimeIncrementAnnot")) -min 1 -max 10 -fmx 100 -cc "updateGhostData 2 #1" ghostFrameStepSlider; setParent $parent; setUITemplate -popTemplate; prefsUpdateAnimDisplay(); } global proc prefsCreateAssets() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefAssetsCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1 -w 490; frameLayout -label (uiRes("m_createPrefWndUI.kContainers")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label (uiRes("m_createPrefWndUI.kOutliner")) -label1 (uiRes("m_createPrefWndUI.kSelectRoot")) -changeCommand "optionVar -iv containerSelRootsInOutliner #1" containerSelectionCheckBox; intFieldGrp -label (uiRes("m_createPrefWndUI.kChannelBox")) -extraLabel (uiRes("m_createPrefWndUI.kMaxAttrsWithTemplate")) -changeCommand "optionVar -intValue containerChanBoxMaxWithTemplate #1" containerMaxWithTemplate; intFieldGrp -label "" -extraLabel (uiRes("m_createPrefWndUI.kMaxAttrsWithoutTemplate")) -changeCommand "optionVar -intValue containerChanBoxMaxNoTemplate #1" containerMaxWithoutTemplate; intFieldGrp -label (uiRes("m_createPrefWndUI.kAttrEd")) -extraLabel (uiRes("m_createPrefWndUI.kMaxPubAttrsWithNoView")) -changeCommand "optionVar -intValue containerFlatViewCap #1" containerAeGroupSize; setParent $parent; setUITemplate -popTemplate; prefsUpdateAssets(); } global proc prefsCreateCamera() // // Description: // Creates the preference controls for Cameras. // { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefCameraCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kDefaultCameras")) ; columnLayout -adj true; floatSliderGrp -label (uiRes("m_createPrefWndUI.kNearClip")) -f true -min 0.001 -max 1000 -fmn 0.001 -fmx 1000000000 -s 0.001 -v 0.1 -pre 3 -cc "optionVar -fv \"defaultCameraNearClipValue\" #1" DefaultCameraNearClipValue; floatSliderGrp -label (uiRes("m_createPrefWndUI.kFarClip")) -f true -min 0.001 -max 10000 -fmn 0.001 -fmx 1000000000 -pre 3 -s 10 -cc "optionVar -fv \"defaultCameraFarClipValue\" #1" DefaultCameraFarClipValue; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kAnimateCameraTransitions")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kFitView")) -columnWidth 2 250 -changeCommand "optionVar -iv animateRoll #1" animatedCameraFitViewCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kFitAllView")) -columnWidth 2 250 -changeCommand "optionVar -iv animateRollFitAll #1" animatedCameraFitViewAllCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kGoToBookmark")) -columnWidth 2 250 -changeCommand "optionVar -iv animateRollGotoBookmark #1" animatedCameraBookmarksCheckBox; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kNextCameraview")) -columnWidth 2 250 -changeCommand "optionVar -iv animateRollNextLastCameraView #1" animatedCameraNextLastCameraViewCheckBox; floatSliderGrp -label (uiRes("m_createPrefWndUI.kTotalTime")) -field true -min 0.1 -max 5.0 -fieldMinValue 0.1 -fieldMaxValue 10.0 -pre 1 -s 0.1 -cc "optionVar -fv \"totalAnimateRollTime\" #1" animatedCameraTotalAnimateTimeFloatField; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kViewFit")) ; columnLayout -adj true; floatSliderGrp -label (uiRes("m_createPrefWndUI.kFitFactor")) -f true -min 0.01 -max 1.00 -pre 2 -s 0.01 -cc "optionVar -fv \"defaultFitFactor\" #1" viewFitDefaultFactorFloatField; setParent $parent; setUITemplate -popTemplate; prefsUpdateCamera(); } global proc prefsCreateViewCube() // // Description: // Creates the preference controls for the ViewCube // { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefViewCubeCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; string $mainColLayout = `columnLayout -adj true`; setParent $mainColLayout; checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 200 -label1 (uiRes("m_createPrefWndUI.kShowViewCube")) -on1 ("viewManip -visible on; optionVar -iv viewCubeShowCube 1") -of1 ("viewManip -visible off; optionVar -iv viewCubeShowCube 0") viewCubeShow; separator -style "none" -h 10; frameLayout -label (uiRes("m_createPrefWndUI.kViewCubeDisplayTitle")) ; columnLayout -adj true; optionMenuGrp -label (uiRes("m_createPrefWndUI.kOnScreenPosition")) -changeCommand ("prefWndViewCubePositionChanged") ViewCubeScreenPosMenu; menuItem -label (uiRes("m_createPrefWndUI.kViewCubeTopRight")); menuItem -label (uiRes("m_createPrefWndUI.kViewCubeBottomRight")); menuItem -label (uiRes("m_createPrefWndUI.kViewCubeTopLeft")); menuItem -label (uiRes("m_createPrefWndUI.kViewCubeBottomLeft")); optionMenuGrp -label (uiRes("m_createPrefWndUI.kViewCubeSize")) -changeCommand ("prefWndViewCubeSizeChanged") ViewCubeSizeMenu; menuItem -label (uiRes("m_createPrefWndUI.kViewCubeSmall")); menuItem -label (uiRes("m_createPrefWndUI.kViewCubeNormal")); menuItem -label (uiRes("m_createPrefWndUI.kViewCubeLarge")); optionMenuGrp -label (uiRes("m_createPrefWndUI.kViewCubeOpacity")) -changeCommand ("prefWndViewOpacityChanged") ViewCubeOpacityMenu; menuItem -label "0%"; menuItem -label "25%"; menuItem -label "50%"; menuItem -label "75%"; menuItem -label "100%"; setParent $mainColLayout; separator -h 10 -style "none"; frameLayout -label (uiRes("m_createPrefWndUI.kDraggingOnViewCubeTitle")) viewCubeClickingFrame; columnLayout -adj true; checkBoxGrp -label "" -cw 1 10 -cw 2 260 -label1 (uiRes("m_createPrefWndUI.kSnapToClosestView")) -on1 ("viewManip -dragSnap on; optionVar -iv viewCubeSnapToClosest 1") -of1 ("viewManip -dragSnap off; optionVar -iv viewCubeSnapToClosest 0") viewCubeSnapToClosestLabel; setParent $mainColLayout; separator -h 10 -style "none"; checkBoxGrp -label "" -cw 1 1 -cw 2 260 -label1 (uiRes("m_createPrefWndUI.kPreserveSceneUp")) -on1 ("viewManip -preserveSceneUp on; optionVar -iv viewCubePreserveSceneUp true") -of1 ("viewManip -preserveSceneUp off; optionVar -iv viewCubePreserveSceneUp false") viewCubePreserveSceneUp; separator -h 10 -style "none"; frameLayout -label (uiRes("m_createPrefWndUI.kClickingOnViewCubeTitle")) ; columnLayout -adj true; checkBoxGrp -label "" -cw 1 1 -cw 2 260 -label1 (uiRes("m_createPrefWndUI.kFitToViewOnViewChange")) -on1 ("viewManip -zoomToFitScene on; optionVar -iv viewCubeFitToView 1") -of1 ("viewManip -zoomToFitScene off; optionVar -iv viewCubeFitToView 0") viewCubeFitToView; checkBoxGrp -label "" -cw 1 1 -cw 2 300 -label1 (uiRes("m_createPrefWndUI.kUseAnimateTransitions")) -on1 ("optionVar -iv animateRollViewCompass true") -of1 ("optionVar -iv animateRollViewCompass false") viewCubeAnimatedTransitions; setParent $mainColLayout; frameLayout -label (uiRes("m_createPrefWndUI.kCompassTitle")) ; columnLayout -adj true; checkBoxGrp -label "" -cw 1 1 -cw 2 260 -label1 (uiRes("m_createPrefWndUI.kShowCompass")) -on1 ("viewManip -dc on; floatSliderGrp -e -enable on viewCubeCompassAngle") -of1 ("viewManip -dc off; floatSliderGrp -e -enable off viewCubeCompassAngle") viewCubeShowCompass; floatSliderGrp -field true -label (uiRes("m_createPrefWndUI.kCompassAngle")) -extraLabel (uiRes("m_createPrefWndUI.kCompassAngleUnits")) -min 0 -max 360 -cc "viewManip -compassAngle #1" -cw 1 118 -cw 4 64 viewCubeCompassAngle; setParent $mainColLayout; setUITemplate -popTemplate; prefsUpdateViewCube(); } global proc prefsCreateSteeringWheel() // // Description: // Creates the preference controls for the SteeringWheel // { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefSteeringWheelCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; string $mainColLayout = `columnLayout -adj true`; setParent $mainColLayout; string $extraLabel = (uiRes("m_createPrefWndUI.kExtra")); string $largeLabel = (uiRes("m_createPrefWndUI.kLarge")); string $normalLabel = (uiRes("m_createPrefWndUI.kNormal")); string $opacityLabel = (uiRes("m_createPrefWndUI.kOpacity")); string $percent25 = (uiRes("m_createPrefWndUI.kTwentyFivePercent")); string $percent50 = (uiRes("m_createPrefWndUI.kFiftyPercent")); string $percent75 = (uiRes("m_createPrefWndUI.kSeventyFivePercent")); string $percent90 = (uiRes("m_createPrefWndUI.kNinetyPercent")); string $smallLabel = (uiRes("m_createPrefWndUI.kSmall")); string $sizeLabel = (uiRes("m_createPrefWndUI.kSize")); frameLayout -label (uiRes("m_createPrefWndUI.kBigWheels")); columnLayout -adj true; floatSliderGrp -label $sizeLabel -minValue 1 -maxValue 3 -cw 1 118 -adj 2 -changeCommand ("steeringWheel -bws #1; optionVar -fv steeringWheelBigSize #1") steeringWheelBigSize; // Put size labels beneath the slider. rowLayout -nc 2 -cw 1 118 -adj 2; separator -style none; formLayout -nd 4 steeringWheelBigSizeLabels; text -label $largeLabel -align right steeringWheelBigSizeLarge; text -label $normalLabel -align center steeringWheelBigSizeNormal; text -label $smallLabel -align left steeringWheelBigSizeSmall; formLayout -e -af steeringWheelBigSizeSmall left 0 -ap steeringWheelBigSizeNormal left 0 1 -ap steeringWheelBigSizeNormal right 0 3 -af steeringWheelBigSizeLarge right 0 steeringWheelBigSizeLabels; setParent ..; setParent ..; separator -style none -h 5; intSliderGrp -label $opacityLabel -minValue 25 -maxValue 90 -cw 1 118 -adj 2 -changeCommand ("steeringWheel -bwo #1; optionVar -iv steeringWheelBigOpacity #1") steeringWheelBigOpacity; // Put percentage labels beneath the slider. rowLayout -nc 2 -cw 1 118 -adj 2; separator -style none; formLayout -nd 65 steeringWheelBigOpacityLabels; text -label $percent90 -align right steeringWheelBigOpacity90; text -label $percent75 -align center steeringWheelBigOpacity75; text -label $percent50 -align center steeringWheelBigOpacity50; text -label $percent25 -align left steeringWheelBigOpacity25; formLayout -e -af steeringWheelBigOpacity25 left 0 -ap steeringWheelBigOpacity50 left 0 20 -ap steeringWheelBigOpacity50 right 0 30 -ap steeringWheelBigOpacity75 left 0 45 -ap steeringWheelBigOpacity75 right 0 55 -af steeringWheelBigOpacity90 right 0 steeringWheelBigOpacityLabels; setParent $mainColLayout; separator -style none -h 5; frameLayout -label (uiRes("m_createPrefWndUI.kMiniWheels")); columnLayout -adj true; floatSliderGrp -label $sizeLabel -minValue 1 -maxValue 4 -cw 1 118 -adj 2 -changeCommand ("steeringWheel -mws #1; optionVar -fv steeringWheelMiniSize #1") steeringWheelMiniSize; // Put size labels beneath the slider. rowLayout -w 490 -nc 2 -cw 1 118 -adj 2; separator -style none; formLayout -nd 6 steeringWheelMiniSizeLabels; text -label $extraLabel -align right steeringWheelMiniSizeExtra; text -label $largeLabel -align center steeringWheelMiniSizeLarge; text -label $normalLabel -align center steeringWheelMiniSizeNormal; text -label $smallLabel -align left steeringWheelMiniSizeSmall; formLayout -e -af steeringWheelMiniSizeSmall left 0 -ap steeringWheelMiniSizeNormal left 0 1 -ap steeringWheelMiniSizeNormal right 0 3 -ap steeringWheelMiniSizeLarge left 0 3 -ap steeringWheelMiniSizeLarge right 0 5 -af steeringWheelMiniSizeExtra right 0 steeringWheelMiniSizeLabels; setParent ..; setParent ..; separator -style none -h 5; intSliderGrp -label $opacityLabel -minValue 25 -maxValue 90 -cw 1 118 -adj 2 -changeCommand ("steeringWheel -mwo #1; optionVar -iv steeringWheelMiniOpacity #1") steeringWheelMiniOpacity; // Put percentage labels beneath the slider. rowLayout -w 490 -nc 2 -cw 1 118 -adj 2; separator -style none; formLayout -nd 65 steeringWheelMiniOpacityLabels; text -label $percent90 -align right steeringWheelMiniOpacity90; text -label $percent75 -align center steeringWheelMiniOpacity75; text -label $percent50 -align center steeringWheelMiniOpacity50; text -label $percent25 -align left steeringWheelMiniOpacity25; formLayout -e -af steeringWheelMiniOpacity25 left 0 -ap steeringWheelMiniOpacity50 left 0 20 -ap steeringWheelMiniOpacity50 right 0 30 -ap steeringWheelMiniOpacity75 left 0 45 -ap steeringWheelMiniOpacity75 right 0 55 -af steeringWheelMiniOpacity90 right 0 steeringWheelMiniOpacityLabels; setParent $mainColLayout; separator -style none -h 5; checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 320 -label1 (uiRes("m_createPrefWndUI.kShowToolMessages")) -on1 ("steeringWheel -stm on; optionVar -iv steeringWheelShowToolMessages 1") -of1 ("steeringWheel -stm off; optionVar -iv steeringWheelShowToolMessages 0") steeringWheelShowToolMessages; checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 320 -label1 (uiRes("m_createPrefWndUI.kShowToolTips")) -on1 ("steeringWheel -stt on; optionVar -iv steeringWheelShowToolTips 1") -of1 ("steeringWheel -stt off; optionVar -iv steeringWheelShowToolTips 0") steeringWheelShowToolTips; checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 320 -label1 (uiRes("m_createPrefWndUI.kShowPinnedWheel")) -on1 ("steeringWheel -pws on; optionVar -iv steeringWheelShowPinnedOnStartup 1") -of1 ("steeringWheel -pws off; optionVar -iv steeringWheelShowPinnedOnStartup 0") steeringWheelShowPinnedWheel; separator -style none -h 5; frameLayout -label (uiRes("m_createPrefWndUI.kLookTool")); checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 200 -label1 (uiRes("m_createPrefWndUI.kInvertVerticalAxis")) -on1 ("steeringWheel -ila on; optionVar -iv steeringWheelInvertLookAxis 1") -of1 ("steeringWheel -ila off; optionVar -iv steeringWheelInvertLookAxis 0") steeringWheelInvertLookAxis; setParent $mainColLayout; separator -style none -h 5; frameLayout -label (uiRes("m_createPrefWndUI.kWalkTool")); columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 400 -label1 (uiRes("m_createPrefWndUI.kConstrainWalk")) -on1 ("steeringWheel -cw on; optionVar -iv steeringWheelConstrainWalkToGround 1") -of1 ("steeringWheel -cw off; optionVar -iv steeringWheelConstrainWalkToGround 0") steeringWheelConstrainWalk; floatSliderGrp -label (uiRes("m_createPrefWndUI.kSpeedFactor")) -cw 1 118 -cw 2 45 -adj 3 -minValue 0.1 -maxValue 10.0 -field on -changeCommand ("steeringWheel -wsf #1; optionVar -fv steeringWheelBigSize #1") steeringWheelWalkSpeedFactor; setParent $mainColLayout; separator -style none -h 5; frameLayout -label (uiRes("m_createPrefWndUI.kZoomTool")); checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 320 -label1 (uiRes("m_createPrefWndUI.kEnableIncrementalZoom")) -on1 ("steeringWheel -iz on; optionVar -iv steeringWheelIncrementalZoom 1") -of1 ("steeringWheel -iz off; optionVar -iv steeringWheelIncrementalZoom 0") steeringWheelIncrementalZoom; setParent $mainColLayout; separator -style none -h 5; frameLayout -label (uiRes("m_createPrefWndUI.kOrbitTool")); formLayout steeringWheelOrbitForm; checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 200 -label1 (uiRes("m_createPrefWndUI.kKeepSceneUpright")) -on1 ("steeringWheel -ksu on; optionVar -iv steeringWheelKeepSceneUpright 1") -of1 ("steeringWheel -ksu off; optionVar -iv steeringWheelKeepSceneUpright 0") steeringWheelKeepSceneUpright; checkBoxGrp -ncb 1 -label "" -cw 1 1 -cw 2 200 -label1 (uiRes("m_createPrefWndUI.kSelectionSensitivity")) -on1 ("steeringWheel -ss on; optionVar -iv steeringWheelSelectionSensitivity 1") -of1 ("steeringWheel -ss off; optionVar -iv steeringWheelSelectionSensitivity 0") steeringWheelSelectionSensitivity; formLayout -e -af steeringWheelKeepSceneUpright left 0 -af steeringWheelSelectionSensitivity right 0 steeringWheelOrbitForm; setParent $mainColLayout; setUITemplate -popTemplate; prefsUpdateSteeringWheel(); } global proc prefsCreateDyn() // // Description: // Creates the preference controls for Dynamics. // dynPrefAutoCreate determines whether rigid bodies are automatically // created when a user tries to connect a field to a geometry object. // dynPrefRunupToCurrentTime determines whether the dynamics system // is run up to the new current time position when the user sets the // time slider forward. // dynPrefRunupFrom determines whether the dynamics system // is run up from previous or current time position when the user // sets the time slider forward. // dynPrefSaveRuntimeState determines whether the runtime state // of particle objects, as well as the initial state, gets saved // to file. // dynPrefParticleEcho determines whether or not particle systems // echo the command that they are executing on collision events. // // // Note that we are dealing with pref values in 3 different places: // The UI controls, which have the current value of the preference // The "current pref", also the current value, which is saved in the TdynStatic // class, and is queried and edited by the "dynPref" action. // The "saved pref", which is saved in the optionVar and is the value which will // be saved to file when maya is quit. // { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefDynCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // If the Dynamics modules isn't loaded, disable everything int $enable = `isTrue "DynamicsExists"`; int $enableAutoCreateRBD = $enable && `getenv "MAYA_ENABLE_LEGACY_RIGID"` !="0"; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kDynamicsTitle")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kAutoCreateRigidBody")) -on1 "dynPref -ac 1" -of1 "dynPref -ac 0" -enable $enableAutoCreateRBD dynAutoCreate; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kRunUpToCurrentTime")) -on1 "dynPrefSetRunup 1" -of1 "dynPrefSetRunup 0" -enable $enable dynRunupToCurrentTime; string $startTime = (uiRes("m_createPrefWndUI.kStartTIme")); radioButtonGrp -label (uiRes("m_createPrefWndUI.kRunUpFrom")) -nrb 2 -labelArray2 (uiRes("m_createPrefWndUI.kPrevTime")) $startTime -on1 "dynPref -rf 1" -on2 "dynPref -rf 2" -enable $enable dynRunupFrom; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kSaveStartup")) -on1 "dynPref -sr 1" -of1 "dynPref -sr 0" -enable $enable dynSaveRuntimeState; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kEchoCollision")) -on1 "dynPref -ec 1" -of1 "dynPref -ec 0" -enable $enable dynEchoCollisionState; setParent $parent; setUITemplate -popTemplate; prefsUpdateDyn(); } global proc setTimeChangeUndoConsolidation(int $value) { if($value > 0) { EnableTimeChangeUndoConsolidation(); }else{ DisableTimeChangeUndoConsolidation(); } } global proc prefsCreateAdvanced() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefAdvancedCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kUndo")) ; columnLayout -adj true; string $off = (uiRes("m_createPrefWndUI.kOffOption")); radioButtonGrp -nrb 2 -label (uiRes("m_createPrefWndUI.kUndoOption")) -labelArray2 (uiRes("m_createPrefWndUI.kRadioOn")) $off -on1 "undoInfo -state on" -on2 "undoInfo -state off" undoEnableRBG; string $finite = (uiRes("m_createPrefWndUI.kFinite")); radioButtonGrp -nrb 2 -label (uiRes("m_createPrefWndUI.kQueue")) -labelArray2 (uiRes("m_createPrefWndUI.kInfinite")) $finite -on1 ("undoInfo -infinity on; intFieldGrp -e -enable false queueSizeIFG") -on2 ("undoInfo -infinity off; intFieldGrp -e -enable true queueSizeIFG") queueLimitRBG; intFieldGrp -label (uiRes("m_createPrefWndUI.kQueueSize")) -cc "undoInfo -length #1" queueSizeIFG; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kTimeChangeUndoConsolidation2")) -cc1 "setTimeChangeUndoConsolidation #1" -cw 2 240 timeChangeUndoConsolidationCB; setParent $parent; setUITemplate -popTemplate; prefsUpdateAdvanced(); } // Respond to preferred renderer change. global proc onPreferredRendererChange() { // If the Preferences window is open, update the preferred Renderer global string $gPreferenceWindow; if (`window -exists $gPreferenceWindow`) prefsUpdateRendering(); } global proc prefsCreateRendering() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefRenderingCol"; // Check to see if this has been created already. // if (`columnLayout -query -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -height 1; frameLayout -label (uiRes("m_createPrefWndUI.kRenderingTitle")) ; columnLayout -adjustableColumn true; // Renderer selection option menu string $renderers[] = `renderer -query -namesOfAvailableRenderers`; string $rendererUIName = ""; optionMenuGrp -columnWidth 1 160 -label (uiRes("m_createPrefWndUI.kPreferredRenderer")) -annotation (uiRes("m_createPrefWndUI.kSelectPreferredRendererAnnot")) -changeCommand updatePreferredRendererSel prefRendererOptionMenu; for ($i = 0; $i < size($renderers); $i += 1) { $rendererUIName = `renderer -query -rendererUIName $renderers[$i]`; menuItem -label $rendererUIName -enableCommandRepeat false ("prefRendererOptionMenuItem" +$i); } int $enableLegacyRenderLayersEnvVarUsed = `getenv("MAYA_ENABLE_LEGACY_RENDER_LAYERS")` == ""; optionMenuGrp -columnWidth 1 160 -label (uiRes("m_createPrefWndUI.kPreferredRenderLayerSystem")) -annotation (uiRes("m_createPrefWndUI.kPreferredRenderLayerSystemAnnot")) -changeCommand updateRenderLayerSystem -enable $enableLegacyRenderLayersEnvVarUsed preferredRenderLayerSystemMenu; menuItem -label (uiRes("m_createPrefWndUI.kRenderLayerSystemSetup")); menuItem -label (uiRes("m_createPrefWndUI.kRenderLayerSystemLayers")); setParent $parent; separator; setUITemplate -popTemplate; // Giving the chance to third parties to add their rendering preferences // callbacks -executeCallbacks -hook "addMayaRenderingPreferences"; setParent $parent; prefsUpdateRendering(); scriptJob -event "preferredRendererChanged" onPreferredRendererChange; } // Description: called when a selection is made in the preferred renderer // option menu. Sets the preferredRenderer optionVar. // Returns: None // global proc updatePreferredRendererSel() { string $selRenderer = `optionMenuGrp -query -value prefRendererOptionMenu`; string $renderers[] = `renderer -query -namesOfAvailableRenderers`; string $rendererUIName = ""; int $preferredRendererExists = 0; //Get the index of the selected renderer // for ($i = 0; $i < size($renderers); $i++) { $rendererUIName = `renderer -query -rendererUIName $renderers[$i]`; if($selRenderer == $rendererUIName) { $preferredRendererExists = 1; break; } } // If the select renderer is not installed, produce error // if(!$preferredRendererExists) { string $error = (uiRes("m_createPrefWndUI.kError")); string $errorMessage = `format -s $rendererUIName $error`; error -showLineNumber true ($errorMessage); } else { optionVar -stringValue "preferredRenderer" $renderers[$i]; } } global proc updateRenderLayerSystem() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $renderLayerSystemLabel = `optionMenuGrp -query -value preferredRenderLayerSystemMenu`; int $preference = renderLayerSystem_PreferenceFromLabel($renderLayerSystemLabel); setRenderLayerSystemInModalPanel $preference; } global proc int renderLayerSystem_PreferenceFromLabel(string $label) { int $preference = 1; if( $label == uiRes("m_createPrefWndUI.kRenderLayerSystemSetup") ) { $preference = 1; } else if( $label == uiRes("m_createPrefWndUI.kRenderLayerSystemLayers") ) { $preference = 0; } return $preference; } global proc string renderLayerSystem_LabelFromPreference(int $preference) { // Default string $label = uiRes("m_createPrefWndUI.kRenderLayerSystemSetup"); if( $preference == 1 ) { $label = uiRes("m_createPrefWndUI.kRenderLayerSystemSetup"); } else if ( $preference == 0 ) { $label = uiRes("m_createPrefWndUI.kRenderLayerSystemLayers"); } return $label; } global proc prefSetProjectVars( int $which ) { // bug #321739 (Autosave) // $which == 2 now means the autosave folder // if ( 2 == $which ) { if ( `textField -q -en autoSaveFolder` ) { string $value = `textField -q -tx autoSaveFolder`; optionVar -sv autoSaveFolder $value; autoSave -folder $value; } return; } string $control; string $value; string $varName; if ( 0 == $which ) { $control = "initialProject"; $varName = "InitialProject"; } else { $control = "projectsDir"; $varName = "ProjectsDir"; } if ( `textField -q -en $control` ) { string $value = `textField -q -tx $control`; if ( $value != "" ) { optionVar -sv $varName `textField -q -tx $control`; } else { optionVar -rm $varName; } } } global proc int prefSetProjectDir( int $which, string $dir, string $type ) { // bug #321739 (Autosave) // $which == 2 now means the autosave folder // if ( 2 == $which ) { textField -e -tx $dir autoSaveFolder; } else if ( 0 == $which) { textField -e -tx $dir initialProject; } else { textField -e -tx $dir projectsDir; } prefSetProjectVars( $which ); return 1; } global proc prefBrowseForFolder( int $which ) { string $action; // The variable "which" used to be a string which included part of the window // title. Then we would have add the "Set" part to the string and then to do // a gmatch to determine which operation we were in the middle of. I've changed // this to be an integer id so we will have the complete text to translate. // I've just arbitrarily chosen 0 as "initial project" and anything else // as "projects dir". // // bug #321739 (Autosave) // $which == 2 now means the autosave folder // if (0 == $which) { $action = (uiRes("m_createPrefWndUI.kSetInitialProject")); } else { $action = (uiRes("m_createPrefWndUI.kSetProjectsDir")); } string $cmd = ("prefSetProjectDir " + $which); string $startInDir; if ( 2 == $which) { $startInDir = `textField -q -tx autoSaveFolder`; if ( size( $startInDir ) == 0 ) { $startInDir = `internalVar -uwd`; } } else if ( 0 == $which) { $startInDir = `textField -q -tx initialProject`; if ( size( $startInDir ) == 0 ) { $startInDir = `internalVar -uwd`; } } else { $startInDir = `textField -q -tx projectsDir`; if ( size( $startInDir ) == 0 ) { $startInDir = `internalVar -uwd`; } } if ( `file -q -ex $startInDir` ) { workspace -dir $startInDir; } fileBrowser( $cmd, $action, "", 4 ); } global proc prefsCreateFileIO() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefFileIOCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kProjectSettings")) ; string $envVar; columnLayout -adj true -cat "left" 35 -cal "left"; text -align "left" -label (uiRes("m_createPrefWndUI.kDefaultProjectsDirectory")) ; columnLayout -adj true -cat "left" 40 -cal "left"; rowLayout -nc 2 -cw2 300 30 -cal 1 "both" -cal 2 "left" -ct2 "both" "left"; textField -cc ( "prefSetProjectVars 1 " ) projectsDir; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseForFolder 1 " ) projectsDirBrowser; setParent ..; $envVar = `getenv "MAYA_PROJECTS_DIR"`; if ( size( $envVar ) > 0 ) { text -al "left" -label (uiRes("m_createPrefWndUI.kSetFromEnvVar")) ; } setParent ..; separator; text -align "left" -label (uiRes("m_createPrefWndUI.kAlwaysStart")) ; columnLayout -adj true -cat "left" 40 -cal "left"; rowLayout -nc 2 -cw2 300 30 -cal 1 "both" -cal 2 "left" -ct2 "both" "left"; textField -cc ( "prefSetProjectVars 0 " ) initialProject; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseForFolder 0 " ) initialProjectBrowser; setParent ..; $envVar = `getenv "MAYA_PROJECT"`; if ( size( $envVar ) > 0 ) { text -al "left" -label (uiRes("m_createPrefWndUI.kSetFromEnvVariable")) ; } setParent ..; setParent $parent; separator -st "none" -h 5; frameLayout -label (uiRes("m_createPrefWndUI.kRecentHistorySize")) ; columnLayout -adj true -cat "left" 15 -cal "center"; intSliderGrp -label (uiRes("m_createPrefWndUI.kFiles")) -f true -min 1 -max 20 -s 1 -cc "optionVar -iv \"RecentFilesMaxSize\" #1" RecentFilesMaxSize; intSliderGrp -label (uiRes("m_createPrefWndUI.kIncrements")) -f true -min 1 -max 20 -s 1 -cc "optionVar -iv \"RecentBackupsMaxSize\" #1" RecentBackupsMaxSize; intSliderGrp -label (uiRes("m_createPrefWndUI.kProjects")) -f true -min 1 -max 20 -s 1 -cc "optionVar -iv \"RecentProjectsMaxSize\" #1" RecentProjectsMaxSize; setParent ..; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kAutoSave")) ; columnLayout -cat "left" 0 -cal "center"; columnLayout -cat "left" 15 -cal "center"; string $autoSaveEnable = `checkBoxGrp -label (uiRes("m_createPrefWndUI.kAutoSaveEnable")) autoSaveEnable`; setParent ..; string $autosavelayout1 = `columnLayout -cat "left" 15 -cal "center" autoSaveLayout1`; checkBoxGrp -label (uiRes("m_createPrefWndUI.kPromptBeforeSave")) -cc ("optionVar -iv autoSavePrompt #1; autoSave -prompt #1;") autoSavePrompt; checkBoxGrp -label (uiRes("m_createPrefWndUI.kLimitAutoSaves")) -cc ("optionVar -iv autoSaveLimitBackups #1; autoSave -limitBackups #1;" + "intSliderGrp -e -en #1 autoSaveMaxBackups;" ) autoSaveLimitBackups; intSliderGrp -label (uiRes("m_createPrefWndUI.kNumberOfAutoSaves")) -min 1 -max 100 -f true -enable `optionVar -q autoSaveLimitBackups` -cc ("optionVar -iv autoSaveMaxBackups #1; autoSave -maxBackups #1;") autoSaveMaxBackups; intSliderGrp -label (uiRes("m_createPrefWndUI.kAutoSaveInterval")) -min 1 -max 100 -f true -cc ("optionVar -iv autoSaveInterval #1; autoSave -interval (60*#1);") autoSaveInterval; string $autoSaveDest = `radioButtonGrp -nrb 3 -label (uiRes("m_createPrefWndUI.kAutoSaveFolder")) -labelArray3 (uiRes("m_createPrefWndUI.kProject")) (uiRes("m_createPrefWndUI.kNamedFolder")) (uiRes("m_createPrefWndUI.kEnvVar")) autoSaveDestination`; setParent ..; string $autosavelayout2 = `columnLayout -adj true -cat "left" 75 -cal "left" autoSaveLayout2`; string $autosavebrowselayout = `rowLayout -nc 2 -cw2 300 50 -cal 1 "both" -cal 2 "left" -ct2 "both" "left" autoSaveBrowseLayout`; textField -cc ( "prefSetProjectVars 2 " ) autoSaveFolder; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseForFolder 2 " ) autoSaveFolderBrowser; setParent ..; setParent ..; setParent ..; setParent $parent; checkBoxGrp -e -cc ("optionVar -iv autoSaveEnable #1;" + "autoSave -en #1;" + "layout -e -en #1 " + $autosavelayout1 + "; layout -e -en #1 " + $autosavelayout2 + ";" + "{ int $autoSaveDestination = (`optionVar -q autoSaveDestination` == 1); " + "layout -e -en $autoSaveDestination " + $autosavebrowselayout + ";}") $autoSaveEnable; radioButtonGrp -e -on1 ("optionVar -iv autoSaveDestination 0; autoSave -destination 0; layout -e -en 0 " + $autosavebrowselayout) -on2 ("optionVar -iv autoSaveDestination 1; autoSave -destination 1; layout -e -en 1 " + $autosavebrowselayout) -on3 ("optionVar -iv autoSaveDestination 2; autoSave -destination 2; layout -e -en 0 " + $autosavebrowselayout) $autoSaveDest; separator; frameLayout -label (uiRes("m_createPrefWndUI.kCrashInfo")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kDisplayCrashInfo")) -changeCommand "optionVar -intValue displayCrashInfo #1" -annotation (uiRes("m_createPrefWndUI.kDisplayCrashInfoAnnot")) -value1 `optionVar -query displayCrashInfo` crashDisplayInfoCBG; setParent $parent; separator; frameLayout -label (uiRes("m_createPrefWndUI.kAsciiFileCompressionMode")) ; columnLayout -adj true; string $uncompressed = (uiRes("m_createPrefWndUI.kUncompressed")); string $asIs = (uiRes("m_createPrefWndUI.kAsIs")); radioButtonGrp -nrb 3 -columnWidth 4 80 -label (uiRes("m_createPrefWndUI.kOnFileSave")) -labelArray3 (uiRes("m_createPrefWndUI.kCompressed")) $uncompressed $asIs -on1 "translator -cmp \"compressed\"" -on2 "translator -cmp \"uncompressed\"" -on3 "translator -cmp \"asCompressed\"" compressionRBG; setParent $parent; separator; string $fileImportMerge = (uiRes("m_createPrefWndUI.kFileImportMerge")); string $byNone = (uiRes("m_createPrefWndUI.kNoneRadioOption")); string $byNumber = (uiRes("m_createPrefWndUI.kByNumber")); string $byName = (uiRes("m_createPrefWndUI.kByName")); frameLayout -label (uiRes("m_createPrefWndUI.kDisplayLayer")) ; columnLayout -adj true; radioButtonGrp -nrb 3 -columnWidth 4 80 -label $fileImportMerge -labelArray3 $byNone $byNumber $byName -on1 "optionVar -iv displayLayerMerge 0" -on2 "optionVar -iv displayLayerMerge 1" -on3 "optionVar -iv displayLayerMerge 2" layerMerge; setParent $parent; separator; frameLayout -l (uiRes("m_createPrefWndUI.kRenderLayer")); columnLayout -adj true; radioButtonGrp -nrb 3 -columnWidth 4 80 -label $fileImportMerge -labelArray3 $byNone $byNumber $byName -on1 "editRenderLayerGlobals -mergeType 0" -on2 "editRenderLayerGlobals -mergeType 1" -on3 "editRenderLayerGlobals -mergeType 2" renderLayerMerge; setParent $parent; separator; string $fileDialogStyle = (uiRes("m_createPrefWndUI.kFileDialogType")); string $osNative = (uiRes("m_createPrefWndUI.kOSNative")); string $mayaNative = (uiRes("m_createPrefWndUI.kMayaFileDialog")); frameLayout -l (uiRes("m_createPrefWndUI.kFileDialog")); columnLayout -adj true; radioButtonGrp -nrb 2 -label $fileDialogStyle -labelArray2 $osNative $mayaNative -on1 "optionVar -iv FileDialogStyle 1" -on2 "optionVar -iv FileDialogStyle 2" fileDialogPrefsRBG; separator; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kHideExtensions")) -changeCommand "optionVar -iv FileDialogHideExtension #1" fileDialogHideExtensionsCBG; setParent $parent; frameLayout -l (uiRes("m_createPrefWndUI.kFileVersion")); columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kIgnoreVersion")) -changeCommand "optionVar -intValue fileIgnoreVersion #1" -annotation (uiRes("m_createPrefWndUI.kIgnoreVersionAnnot")) -value1 `optionVar -query fileIgnoreVersion` fileIgnoreVersionCBG; setParent $parent; frameLayout -l (uiRes("m_createPrefWndUI.kImageFiles")); columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kAutoloadTextures")) -enable (`pluginInfo -q -loaded "modelingToolkit"`) -changeCommand "nexOpt -e autoloadTextures #1" MT_autoloadTexturesCBG; frameLayout -l (uiRes("m_createPrefWndUI.kFileOpenErrors")); columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_createPrefWndUI.kCanSuppressErrorDialog")) -changeCommand "optionVar -iv canSuppressFileOpenErrorDialog #1" -value1 `optionVar -query canSuppressFileOpenErrorDialog` fileSuppressErrorDialogCBG; setParent $parent; setUITemplate -popTemplate; prefsUpdateFileIO(); } global proc prefsCreateModules() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefModulesCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kLoadOnStartup")) ; columnLayout -adj true; checkBoxGrp -ncb 1 -label "" -cw 1 75 -label1 (uiRes("m_createPrefWndUI.kDynamics")) -on1 "optionVar -iv loadDynamics 1" -of1 "optionVar -iv loadDynamics 0" packCBG1; checkBoxGrp -ncb 1 -label "" -cw 1 75 -label1 (uiRes("m_createPrefWndUI.kPaintEffects")) -on1 "optionVar -iv loadUrchin 1" -of1 "optionVar -iv loadUrchin 0" packCBG8; // On Mac its not possible to stop the loading of Paint Effects (libUrchin) // and Dynamics on startup, hence do not allow the user to change this preference if (`about -mac`) { checkBoxGrp -e -en false packCBG8; checkBoxGrp -e -en false packCBG1; } setParent $parent; setUITemplate -popTemplate; prefsUpdateModules(); } global proc prefsCreateOpenMaya() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefOpenMayaCol"; // openMaya prefs are not available on NT if (`about -nt`) return; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kOpenMaya")) ; columnLayout -adj true; string $bindNow = (uiRes("m_createPrefWndUI.kBindNow")); radioButtonGrp -nrb 2 -label (uiRes("m_createPrefWndUI.kLoading")) -cw 1 150 -labelArray2 (uiRes("m_createPrefWndUI.kLazyBinding")) $bindNow -sl (`optionVar -q apiPrefLazyLoading` ? 1 : 2) -on1 "openMayaPref -e -lz true" -on2 "openMayaPref -e -lz false" lazyLoadingCheck; string $disbaled = (uiRes("m_createPrefWndUI.kDisabled")); radioButtonGrp -nrb 2 -label (uiRes("m_createPrefWndUI.kOldPluginWarning")) -cw 1 150 -labelArray2 (uiRes("m_createPrefWndUI.kEnabled")) $disbaled -sl (`optionVar -q apiPrefOldPluginWarning` ? 1 : 2) -on1 "openMayaPref -e -ow true" -on2 "openMayaPref -e -ow false" oldPluginWarningCheck; setParent $parent; setUITemplate -popTemplate; prefsUpdateOpenMaya(); } global proc int validFontMenuOptionItem(string $item, string $optionMenu) { string $items[] = `optionMenuGrp -query -itemListLong $optionMenu`; int $index, $count = `size($items)`; for($index = 0; $index < $count; $index++) { if($item == `menuItem -q -label $items[$index]`) { // Found match return true; } } // Did not find a match return false; } global proc prefsCreateSaveActions() { global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefSaveActionsCol"; // Check to see if this has been created already. // if (`columnLayout -q -numberOfChildren $parent` > 0) { return; } // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -h 1; frameLayout -label (uiRes("m_createPrefWndUI.kPreferencesAndSettings")) ; columnLayout -adj true; checkBox -label (uiRes("m_createPrefWndUI.kSaveAllPreferences")) -cc "optionVar -iv saveActionsPreferences #1" saveActionsPreferencesOption; setParent $parent; frameLayout -label (uiRes("m_createPrefWndUI.kScriptEditorInput")) ; columnLayout -adj true; checkBox -label (uiRes("m_createPrefWndUI.kSaveScriptEditorInput")) -cc "optionVar -iv saveActionsScriptEditor #1" saveActionsScriptEditorOption; setParent $parent; setUITemplate -popTemplate; prefsUpdateSaveActions(); } global proc prefSetCmdPath( string $identifier ) { string $control; string $value; string $varName; if ( $identifier == "viewimage" ) { $control = "viewImageDir"; $varName = "ViewImageDir"; } else if ( $identifier == "viewImageCmdFormat" ) { $control = "viewImageCmdFmt"; $varName = "ViewImageCmdFormat"; } else if ( $identifier == "viewSequence" ) { $control = "viewSequenceDir"; $varName = "ViewSequenceDir"; } else if ( $identifier == "viewSequenceCmdFormat" ) { $control = "viewSequenceCmdFmt"; $varName = "ViewSequenceCmdFormat"; } else if ( $identifier == "editimage" ) { $control = "editimageDir"; $varName = "EditImageDir"; } else if ( $identifier == "photoshop" ) { $control = "photoshopDir"; $varName = "PhotoshopDir"; } else if ( $identifier == "playblastAvi" ) { $control = "playblastCmdAvi"; $varName = "PlayblastCmdAvi"; } else if ( $identifier == "playblastQuicktime" ) { $control = "playblastCmdQuicktime"; $varName = "PlayblastCmdQuicktime"; } else if ( $identifier == "playblastCmdFormatAvi" ) { $control = "playblastCmdFmtAvi"; $varName = "PlayblastCmdFormatAvi"; } else if ( $identifier == "playblastCmdFormatQuicktime" ) { $control = "playblastCmdFmtQuicktime"; $varName = "PlayblastCmdFormatQuicktime"; } if ( `textField -q -en $control` ) { string $value = `textField -q -tx $control`; if ( $value != "" ) { optionVar -sv $varName `textField -q -tx $control`; } else { optionVar -rm $varName; } } } global proc prefBrowseCmdPath( string $identifier ) { string $caption = (uiRes("m_createPrefWndUI.kBrowseForImage")); string $cmd = "fileDialog2 -caption \"" + $caption + "\" -fileMode 1"; // always use the native dialog to pick .app on the Mac if (`about -mac`) $cmd += " -dialogStyle 1"; string $path[] = eval($cmd); if (0 < size($path) && $path[0] != "") { if ( $identifier == "viewimage" ) { textField -e -fi $path[0] viewImageDir; } else if ( $identifier == "photoshop" ) { textField -e -fi $path[0] photoshopDir; } else if ( $identifier == "editimage" ) { textField -e -fi $path[0] editimageDir; } else if ( $identifier == "viewSequence" ) { textField -e -fi $path[0] viewSequenceDir; } else if ( $identifier == "playblastAvi" ) { textField -e -fi $path[0] playblastCmdAvi; } else if ( $identifier == "playblastQuicktime" ) { textField -e -fi $path[0] playblastCmdQuicktime; } prefSetCmdPath( $identifier ); } } global proc prefsExternalApplications() { string $fcheck_app = "fcheck"; string $l10n_fcheck = (uiRes("m_createPrefWndUI.kFcheck")); string $l10n_optflags = (uiRes("m_createPrefWndUI.kOptionalFlags")); global string $gPreferenceWindow; setParent $gPreferenceWindow; string $parent = "prefExternalAppCol"; // Check to see if this has been created already. // if (`columnLayout -query -numberOfChildren $parent` > 0) return; // Create the UI // setParent $parent; setUITemplate -pushTemplate prefsTemplate; // This is used to force the width to fill the window separator -style "none" -height 1; //Application Path For viewing the Images // This is used to force the width to fill the window separator -style "none" -height 3; frameLayout -collapsable true -label (uiRes("m_createPrefWndUI.kPathForImageViewingApps")); columnLayout -adjustableColumn true; rowLayout -nc 3 -cw3 300 25 140 -cal 1 "left" -cal 2 "left" -cal 3 "left" -ct3 "both" "left" "both"; text -label (uiRes("m_createPrefWndUI.kImageViewingApp")); text -label (""); text -label $l10n_optflags; setParent ..; rowLayout -nc 3 -cw3 300 25 140 -cal 1 "both" -cal 2 "left" -cal 3 "both" -ct3 "both" "left" "both"; textField -cc ("prefSetCmdPath viewimage") viewImageDir; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseCmdPath viewimage" ) viewImageBrowser; textField -cc ("prefSetCmdPath viewImageCmdFormat") viewImageCmdFmt; setParent ..; setParent $parent; frameLayout -collapsable true -label (uiRes("m_createPrefWndUI.kPathForImageEditingApps")); columnLayout -adjustableColumn true; rowLayout -nc 2 -cw2 300 25 -cal 1 "left" -cal 2 "left" -ct2 "both" "left"; text -label (uiRes("m_createPrefWndUI.kAppPathEditPhotoshopImages")); text -label ""; setParent ..; rowLayout -nc 2 -cw2 300 25 -cal 1 "both" -cal 2 "left" -ct2 "both" "left"; textField -cc ("prefSetCmdPath photoshop") photoshopDir; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseCmdPath photoshop" ) photoshopBrowser; setParent ..; rowLayout -nc 2 -cw2 300 25 -cal 1 "left" -cal 2 "left" -ct2 "both" "left"; text -label (uiRes("m_createPrefWndUI.kAppPathEditOtherImages")); text -label ""; setParent ..; string $default = (`about -linux`) ? $l10n_fcheck : (uiRes("m_createPrefWndUI.kSystemAssoc")) ; rowLayout -nc 2 -cw2 300 25 -cal 1 "left" -cal 2 "left" -ct2 "both" "left"; textField -cc ("prefSetCmdPath editimage") editimageDir; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseCmdPath editimage" ) editimageBrowser; setParent ..; setParent $parent; //Application Path For Sequences // This is used to force the width to fill the window separator -style "none" -height 3; frameLayout -collapsable true -label (uiRes("m_createPrefWndUI.kPathForSequences")); columnLayout -adjustableColumn true; rowLayout -nc 3 -cw3 300 25 140 -cal 1 "left" -cal 2 "left" -cal 3 "left" -ct3 "both" "left" "both"; text -label (uiRes("m_createPrefWndUI.kImageSequence")); text -label ""; text -label $l10n_optflags; setParent ..; rowLayout -nc 3 -cw3 300 25 140 -cal 1 "both" -cal 2 "left" -cal 3 "both" -ct3 "both" "left" "both"; textField -cc ("prefSetCmdPath viewSequence") viewSequenceDir; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseCmdPath viewSequence" ) editimageBrowser; textField -cc ("prefSetCmdPath viewSequenceCmdFormat") viewSequenceCmdFmt; setParent ..; rowLayout -nc 3 -cw3 300 25 140 -cal 1 "left" -cal 2 "left" -cal 3 "left" -ct3 "both" "left" "both"; text -label (uiRes("m_createPrefWndUI.kAVIFileType")); text -label ""; text -label $l10n_optflags; setParent ..; rowLayout -nc 3 -cw3 300 25 140 -cal 1 "both" -cal 2 "left" -cal 3 "both" -ct3 "both" "left" "both"; textField -cc ("prefSetCmdPath playblastAvi") playblastCmdAvi; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseCmdPath playblastAvi" ) playblastBrowserAvi; textField -cc ("prefSetCmdPath playblastCmdFormatAvi") playblastCmdFmtAvi; setParent ..; rowLayout -nc 3 -cw3 300 25 140 -cal 1 "left" -cal 2 "left" -cal 3 "left" -ct3 "both" "left" "both"; text -label (uiRes("m_createPrefWndUI.kQuicktimeFileType")); text -label ""; text -label $l10n_optflags; setParent ..; rowLayout -nc 3 -cw3 300 25 140 -cal 1 "both" -cal 2 "left" -cal 3 "both" -ct3 "both" "left" "both"; textField -cc ("prefSetCmdPath playblastQuicktime") playblastCmdQuicktime; symbolButton -image "navButtonBrowse.png" -c ( "prefBrowseCmdPath playblastQuicktime" ) playblastBrowserQuicktime; textField -cc ("prefSetCmdPath playblastCmdFormatQuicktime") playblastCmdFmtQuicktime; setParent ..; setParent $parent; // This is used to force the width to fill the window separator -style "none" -height 3; frameLayout -label (uiRes("m_createPrefWndUI.kExternalCommunication")); columnLayout -adj true; checkBoxGrp -ncb 1 -label (uiRes("m_createPrefWndUI.kDefaultCommandPort")) -label1 (uiRes("m_createPrefWndUI.kEnableOption")) -columnWidth 2 250 -value1 ( (`optionVar -q "commandportOpenByDefault"`)) -changeCommand "optionVar -iv commandportOpenByDefault #1 ; control -e -en #1 commandportDefaultNameTextField" commandportOpenByDefaultCheckBox; textFieldGrp -label (uiRes("m_createPrefWndUI.kName")) -en ( (`optionVar -q "commandportOpenByDefault"`)) -text ( (`optionVar -q "commandportDefaultName"`)) -changeCommand "optionVar -sv commandportDefaultName `textFieldGrp -q -text commandportDefaultNameTextField`" commandportDefaultNameTextField; setUITemplate -popTemplate; prefsUpdateExternalApps(); prefsUpdateCommandPortDefaults(); } global proc updateImageViewerCommandState() // Enable or disable the Image Viewer Command fields { int $val = `optionVar -q "fcheckAsImageViewer"`; textFieldGrp -edit -en (!$val) imageViewerCmdImageText; textFieldGrp -edit -en (!$val) imageViewerCmdSequenceText; } global proc updateLineWidth(float $w) { global string $gLineWidthSliderStr; float $width = $w; floatSliderGrp -e -value $width $gLineWidthSliderStr; displayPref -lineWidth $width; } global proc string renderingEngine_LabelFromPreference(string $preference) // Description // // Convert the preference value of the rendering engine to // the corresponding label in the rendering engine list (vp2RenderingEngineMenu) // { // Default is OpenGL string $label = uiRes("m_createPrefWndUI.kVPTwoRenderingOpenGL"); if( $preference == "DirectX11" ) { $label = uiRes("m_createPrefWndUI.kVPTwoRenderingDirectXEleven"); } if (`about -mac` && $preference == "OpenGLCoreProfileCompat") { $preference = "OpenGLCoreProfile"; } if( $preference == "OpenGLCoreProfile" ) { $label = uiRes("m_createPrefWndUI.kVPTwoRenderingOpenGLCoreProfile"); } if( $preference == "OpenGLCoreProfileCompat" ) { $label = uiRes("m_createPrefWndUI.kVPTwoRenderingOpenGLCoreProfileCompat"); } return $label; } global proc string renderingEngine_PreferenceFromLabel(string $label) // Description // // Convert label from the rendering engine list (vp2RenderingEngineMenu) // the corresponding preference value // { // Default is OpenGL string $preference = "OpenGL"; if( $label == uiRes("m_createPrefWndUI.kVPTwoRenderingDirectXEleven") ) { $preference = "DirectX11"; } if( $label == uiRes("m_createPrefWndUI.kVPTwoRenderingOpenGLCoreProfile") ) { $preference = "OpenGLCoreProfile"; } if( $label == uiRes("m_createPrefWndUI.kVPTwoRenderingOpenGLCoreProfileCompat") ) { $preference = "OpenGLCoreProfileCompat"; } return $preference; } global proc string[] getPreferredRenderingEngineAndOverrideFlag() // Description // // Get the preferred rendering engine : // - first check for override - MAYA_VP2_DEVICE_OVERRIDE env var, // - then get the preference value - vp2RenderingEngine // // Returns the rendering engine string and "true" or "false" if this // values comes from the override // { string $engine = ""; int $isOverride = false; string $deviceOverride = `getenv "MAYA_VP2_DEVICE_OVERRIDE"`; global string $gDeviceDirectX11; global string $gDeviceOpenGLCoreProfile; global string $gDeviceOpenGLLegacy; if($deviceOverride == $gDeviceDirectX11) { $engine = "DirectX11"; $isOverride = true; } if($deviceOverride == $gDeviceOpenGLCoreProfile) { $engine = "OpenGLCoreProfile"; $isOverride = true; } if($deviceOverride == $gDeviceOpenGLLegacy) { $engine = "OpenGL"; $isOverride = true; } if($engine == "") { // Default is OpenGLCoreProfile $engine = "OpenGLCoreProfile"; if(`optionVar -exists vp2RenderingEngine`) { $engine = `optionVar -query vp2RenderingEngine`; } } string $values[2]; $values[0] = $engine; $values[1] = ($isOverride ? "true" : "false"); return $values; } global proc string getPreferredRenderingEngine() // Description // // Returns the rendering engine string - see getPreferredRenderingEngineAndOverrideFlag // { string $renderingEngine[2] = getPreferredRenderingEngineAndOverrideFlag(); return $renderingEngine[0]; } global proc fixOldVp2RenderingEnginePreference() // Description // // Convert rendering engine preference saved in old format (integer) // to new format (string) // { if(`optionVar -exists vp2RenderingEngine`) { $engine = `optionVar -query vp2RenderingEngine`; // Old preference value was saved as integer (1, 2 or 3) if( size($engine) == 1 ) { int $engineIdx = $engine; int $renderingEngineDx11_Idx = 1; //int $renderingEngineGL_Idx = 2; int $renderingEngineGLCore_Idx = 3; // Default is OpenGL $engine = "OpenGL"; if( $engineIdx == $renderingEngineDx11_Idx ) { $engine = "DirectX11"; } if( $engineIdx == $renderingEngineGLCore_Idx ) { $engine = "OpenGLCoreProfile"; } // Save preference with updated value optionVar -sv vp2RenderingEngine $engine; } } } global proc prefsChangeTimeControlHeight(int $height) { global string $gPlayBackSlider; // The TimeSlider might have some custom controls drawing above/below it // so we need to add that space back in as it was dynamically added. // This value is DPI scaled, so we need to reverse it. int $tsOutsideSpacing = `timeControl -q -outsideSpacing $gPlayBackSlider`; if (`exists mayaDpiSetting`) { float $rsv = `mayaDpiSetting -q -realScaleValue`; $tsOutsideSpacing = $tsOutsideSpacing / $rsv; } int $newHeight = $height + $tsOutsideSpacing; timeControl -e -h $newHeight $gPlayBackSlider; } // Call the fix method so the preference is updated on startup (before the vp2.0 is initialized) fixOldVp2RenderingEnginePreference();