// =========================================================================== // 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: 2002 // // Description: Create a locator that shows the elevation of an pond's // surface // global proc pondLocator(string $pond, float $px, float $py) { string $nType = nodeType( $pond ); if( $nType != "fluidShape" ){ warning((uiRes("m_pondLocator.kNeedFluidShape"))); return; } string $pondParent[] = `listRelatives -parent $pond`; string $ptform = $pondParent[0]; string $result[] = `spaceLocator -p $px 0.0 $py`; string $loc = $result[0]; string $exp = ( "float $u = " + $loc + ".tx;\n" +"float $v = " + $loc + ".tz;\n" +"float $disp = ` fluidValueAtPoint "+$pond+" $u 0 $v density`;\n" +"float $depth = " + $pond + ".dimensionsD;\n" +"float $dscale = " + $ptform + ".scaleZ;\n" +$loc+".ty = $disp * $depth * $dscale;\n" ); expression -s $exp; }