// =========================================================================== // 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: Dec, 2001 // // Description: // This script assigns an ocean shader to the selection list // and automatically turns off feature based displacement. // global proc assignOceanShader( string $sg ) { // Assign the shading group to the selected objects. // hyperShade -assign $sg; string $selection[] = `ls -sl -dag -type geometryShape`; int $turnedOff = false; int $i; string $item; for ($i = 0; $i < size($selection); $i++){ $item = $selection[$i]; int $state = getAttr( $item + ".featureDisplacement" ); if( $state != false ){ setAttr ($item + ".featureDisplacement") false; $turnedOff = true; } } if( $turnedOff ){ warning( (uiRes("m_assignOceanShader.kTurnedOff")) ); } }