// =========================================================================== // 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: In a galaxy far far away a long time ago // // Procedure Name(s): // texOrientShells // // Description: // Orienting UV shells for the best area of the bounding box. // // Input Arguments // None. // // Return Value: // None. // // // =========================================================================== global proc texOrientShells() { texCheckSelection("any"); // Get original selection string $selection[] = `ls -selection`; string $compSelType = `getComponentMask`; string $selectObj[] = `ls -objectsOnly -selection`; for ($o in $selectObj) { string $selectComponent[] = `ls -sl $o`; polyLayoutUV -flipReversed 0 -layout 0 -layoutMethod 1 -percentageSpace 0.2 -rotateForBestFit 3 -scale 0 -separate 0 $selectComponent ; } //restore the original component mask setComponentMask($compSelType); //select the original selection select -replace $selection; }