// =========================================================================== // 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. // =========================================================================== // // Description: // This script creates menu items to add objects to bakeSets. // global proc string createBakeSet (string $name, string $type) { string $selectionList[] = `ls -selection`; // Create the bakeSet node. // string $bakeSetName = `createNode -n $name $type`; // Add the new bakeSet to the appropriate partition. // if( $type == "vertexBakeSet" ) { if( size(`ls vertexBakePartition`) < 1 ) { partition -n "vertexBakePartition" $bakeSetName; } else { partition -add "vertexBakePartition" $bakeSetName; } // Add two dynamic attributes to the vertexBakeSet node. // addAttr -ln filterSize -sn fs -min -1 $bakeSetName; setAttr ($bakeSetName+".filterSize") 0.001; addAttr -ln filterNormalTolerance -sn fns -min 0 -max 180 $bakeSetName; setAttr ($bakeSetName+".filterNormalTolerance") 5; } else { if( size(`ls textureBakePartition`) < 1 ) { partition -n "textureBakePartition" $bakeSetName; } else { partition -add "textureBakePartition" $bakeSetName; } } // Restore the selection list. select -r $selectionList; return $bakeSetName; }