// =========================================================================== // 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. // =========================================================================== global proc string getFluidShape(string $object) { string $fluidShape[]; string $objectArray[1]; $objectArray[0] = $object; // First see if $object is itself a fluid shape. If it is return it. // $fluidShape = `ls -type fluidShape -type fluidTexture3D -type fluidTexture2D $objectArray`; if (size($fluidShape) > 0) { return $fluidShape[0]; } // If $object is not a particle shape, perhaps it is the transform of // a particle shape. If so, return it. // string $transforms[]; string $children[]; $transforms = `ls -type transform $objectArray`; if (size($transforms) > 0) { $children = `listRelatives -s $transforms[0]`; $fluidShape = `ls -type fluidShape -type fluidTexture3D -type fluidTexture2D $children`; if (size($fluidShape) > 0) { return $fluidShape[0]; } } // If $object is neither a particle shape nor a transform of a particle // shape, then return nothing. // return ""; } global proc string[] getActiveFluidShapes() { string $activeFluids[]; string $selection[] = `ls -sl`; for( $s in $selection ) { string $tryThis = getFluidShape( $s ); if( size( $tryThis ) ) { $activeFluids[ size($activeFluids) ] = $tryThis; } } return $activeFluids; }