// =========================================================================== // 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: 1 December 1996 // // // Procedure Name: // selectionMaskStack // // Description: // The selection mask stack initialization // // Input Arguments: // None. // // Return Value: // None. // proc string captureSelectionMaskAndPrefs() { string $command; // The highlight info: $command = ("selectPref -allowHiliteSelection " + `selectPref -q -allowHiliteSelection` + // Affects active: " -affectsActive " + `selectPref -q -affectsActive` + // Ignore/Respect selection priorities " -ignoreSelectionPriority " + `selectPref -q -ignoreSelectionPriority` + "; " ); // The select type: $command = ( $command + "selectType" // object selection masks +" -handle " + `selectType -q -handle` +" -ikHandle " + `selectType -q -ikHandle` +" -joint " + `selectType -q -joint` +" -nurbsCurve " + `selectType -q -nurbsCurve` +" -cos " + `selectType -q -cos` +" -nurbsSurface " + `selectType -q -nurbsSurface` +" -polymesh " + `selectType -q -polymesh` +" -subdiv " + `selectType -q -subdiv` +" -plane " + `selectType -q -plane` +" -stroke " + `selectType -q -stroke` +" -lattice " + `selectType -q -lattice` +" -cluster " + `selectType -q -cluster` +" -sculpt " + `selectType -q -sculpt` +" -nonlinear " + `selectType -q -nonlinear` +" -particleShape " + `selectType -q -particleShape` +" -emitter " + `selectType -q -emitter` +" -field " + `selectType -q -field` +" -fluid " + `selectType -q -fluid` +" -hairSystem " + `selectType -q -hairSystem` +" -follicle " + `selectType -q -follicle` +" -nCloth " + `selectType -q -nCloth` +" -nRigid " + `selectType -q -nRigid` +" -dynamicConstraint " + `selectType -q -dynamicConstraint` +" -spring " + `selectType -q -spring` +" -rigidBody " + `selectType -q -rigidBody` +" -rigidConstraint " + `selectType -q -rigidConstraint` +" -collisionModel " + `selectType -q -collisionModel` +" -light " + `selectType -q -light` +" -camera " + `selectType -q -camera` +" -texture " + `selectType -q -texture` +" -ikEndEffector " + `selectType -q -ikEndEffector` +" -locator " + `selectType -q -locator` +" -dimension " + `selectType -q -dimension` +" -motionTrailPoint " + `selectType -q -motionTrailPoint` +" -motionTrailTangent " + `selectType -q -motionTrailTangent` // component selection masks +" -cv " + `selectType -q -cv` +" -vertex " + `selectType -q -vertex` +" -subdivMeshPoint " + `selectType -q -subdivMeshPoint` +" -latticePoint " + `selectType -q -latticePoint` +" -particle " + `selectType -q -particle` +" -editPoint " + `selectType -q -editPoint` +" -curveParameterPoint " + `selectType -q -curveParameterPoint` +" -surfaceParameterPoint " + `selectType -q -surfaceParameterPoint` +" -polymeshUV " + `selectType -q -polymeshUV` +" -polymeshEdge " + `selectType -q -polymeshEdge` +" -subdivMeshEdge " + `selectType -q -subdivMeshEdge` +" -isoparm " + `selectType -q -isoparm` +" -surfaceEdge " + `selectType -q -surfaceEdge` +" -surfaceFace " + `selectType -q -surfaceFace` +" -springComponent " + `selectType -q -springComponent` +" -facet " + `selectType -q -facet` +" -subdivMeshFace " + `selectType -q -subdivMeshFace` +" -hull " + `selectType -q -hull` +" -rotatePivot " + `selectType -q -rotatePivot` +" -scalePivot " + `selectType -q -scalePivot` +" -jointPivot " + `selectType -q -jointPivot` +" -selectHandle " + `selectType -q -selectHandle` +" -localRotationAxis " + `selectType -q -localRotationAxis` +" -imagePlane " + `selectType -q -imagePlane` +"; " ); // The select priority: $command = ( $command + "selectPriority" // object selection masks +" -handle " + `selectPriority -q -handle` +" -ikHandle " + `selectPriority -q -ikHandle` +" -joint " + `selectPriority -q -joint` +" -nurbsCurve " + `selectPriority -q -nurbsCurve` +" -cos " + `selectPriority -q -cos` +" -nurbsSurface " + `selectPriority -q -nurbsSurface` +" -polymesh " + `selectPriority -q -polymesh` +" -subdiv " + `selectPriority -q -subdiv` +" -plane " + `selectPriority -q -plane` +" -stroke " + `selectPriority -q -stroke` +" -lattice " + `selectPriority -q -lattice` +" -cluster " + `selectPriority -q -cluster` +" -sculpt " + `selectPriority -q -sculpt` +" -nonlinear " + `selectPriority -q -nonlinear` +" -particleShape " + `selectPriority -q -particleShape` +" -emitter " + `selectPriority -q -emitter` +" -field " + `selectPriority -q -field` +" -fluid " + `selectPriority -q -fluid` +" -hairSystem " + `selectPriority -q -hairSystem` +" -follicle " + `selectPriority -q -follicle` +" -nCloth " + `selectPriority -q -nCloth` +" -nRigid " + `selectPriority -q -nRigid` +" -dynamicConstraint " + `selectPriority -q -dynamicConstraint` +" -spring " + `selectPriority -q -spring` +" -rigidBody " + `selectPriority -q -rigidBody` +" -rigidConstraint " + `selectPriority -q -rigidConstraint` +" -collisionModel " + `selectPriority -q -collisionModel` +" -light " + `selectPriority -q -light` +" -camera " + `selectPriority -q -camera` +" -texture " + `selectPriority -q -texture` +" -ikEndEffector " + `selectPriority -q -ikEndEffector` +" -locator " + `selectPriority -q -locator` +" -dimension " + `selectPriority -q -dimension` +" -motionTrailPoint " + `selectPriority -q -motionTrailPoint` +" -motionTrailTangent " + `selectPriority -q -motionTrailTangent` // component selection masks +" -cv " + `selectPriority -q -cv` +" -vertex " + `selectPriority -q -vertex` +" -subdivMeshPoint " + `selectPriority -q -subdivMeshPoint` +" -latticePoint " + `selectPriority -q -latticePoint` +" -particle " + `selectPriority -q -particle` +" -editPoint " + `selectPriority -q -editPoint` +" -curveParameterPoint " + `selectPriority -q -curveParameterPoint` +" -surfaceParameterPoint " + `selectPriority -q -surfaceParameterPoint` +" -polymeshUV " + `selectPriority -q -polymeshUV` +" -polymeshEdge " + `selectPriority -q -polymeshEdge` +" -subdivMeshEdge " + `selectPriority -q -subdivMeshEdge` +" -isoparm " + `selectPriority -q -isoparm` +" -surfaceEdge " + `selectPriority -q -surfaceEdge` +" -surfaceFace " + `selectPriority -q -surfaceFace` +" -springComponent " + `selectPriority -q -springComponent` +" -facet " + `selectPriority -q -facet` +" -subdivMeshFace " + `selectPriority -q -subdivMeshFace` +" -hull " + `selectPriority -q -hull` +" -rotatePivot " + `selectPriority -q -rotatePivot` +" -scalePivot " + `selectPriority -q -scalePivot` +" -jointPivot " + `selectPriority -q -jointPivot` +" -selectHandle " + `selectPriority -q -selectHandle` +" -localRotationAxis " + `selectPriority -q -localRotationAxis` +" -imagePlane " + `selectPriority -q -imagePlane` +"; " ); return $command; } global proc string currentSelectionMask() { string $command = `captureSelectionMaskAndPrefs`; // The selectMode: if( `selectMode -q -root` ) { $command = $command + "selectMode -root; "; } if( `selectMode -q -leaf` ) { $command = $command + "selectMode -leaf; "; } if( `selectMode -q -template` ) { $command = $command + "selectMode -template; "; } if( `selectMode -q -object` ) { $command = $command + "selectMode -object; "; } if( `selectMode -q -preset` ) { $command = $command + "selectMode -preset; "; } if( `selectMode -q -component` ) { $command = $command + "selectMode -component; "; } if( `selectMode -q -hierarchical` ) { $command = $command + "selectMode -hierarchical; "; } return $command; } global proc selectionMaskReset() // // Reset the selection masks to the state they were on startup // { global string $gSelectionMaskInitial; eval( $gSelectionMaskInitial ); } global proc selectionMaskResetAll() // // Reset the selection masks and the selection mode // to the state they were on startup. // { selectionMaskReset(); selectMode -object; } global proc selectionMaskSaveOnce() { global string $gSelectionMaskStack; if( "" == $gSelectionMaskStack ) { $gSelectionMaskStack = `currentSelectionMask`; } } global proc selectionMaskRestoreOnce() { global string $gSelectionMaskStack; if( "" != $gSelectionMaskStack ) { eval( $gSelectionMaskStack ); $gSelectionMaskStack = ""; } } { global string $gSelectionMaskStack; global string $gSelectionMaskInitial; $gSelectionMaskInitial = `captureSelectionMaskAndPrefs`; $gSelectionMaskStack = ""; scriptJob -permanent -event "NewSceneOpened" "selectionMaskResetAll"; scriptJob -permanent -event "SceneOpened" "selectionMaskResetAll"; }