// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // Procedure Name: // createMeshNodeUnder // // Description: // This procedure creates a meshNode with the given name // under the specified parent. It looks up the global // settings and sets the node's attributes appropriately. // global proc string createMeshNodeUnder(string $name, string $parent) { string $mesh = `createNode mesh -n $name -p $parent`; // Initialize the meshNode based on the global settings // int $ival=`optionVar -query polyCreateMeshesSingleSided`; if ($ival) { $ival = 0; } else { $ival = 1; } setAttr ($mesh + ".doubleSided" ) $ival; setAttr ($mesh + ".tangentSpace" ) `optionVar -query polyDefaultTangentSpace`; string $tsaDegrees = `optionVar -query polyDefaultTangentSmoothingAngle`; float $tsa = `convertUnit -fromUnit "deg" $tsaDegrees`; setAttr ($mesh + ".tangentSmoothingAngle" ) $tsa; return $mesh; }