// =========================================================================== // 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: 2007 // // Description: // Get a list of Fluid objects for caching. // // global proc string[] getFluidObjectsToCache(int $showError) { string $objsToCache[] = `ls -sl -type fluidShape`; if (0 == size($objsToCache)) { string $shapes[] = getGeometriesToCache(); string $shape; for ($shape in $shapes) { string $fluidShape = findTypeInHistory($shape,"fluidShape", 0, 1); if (size($fluidShape)) { $objsToCache[size($objsToCache)] = $fluidShape; } } } // append any additional geometries that are in cache groups with // the specified geometries // int $ii, $objCount = size($objsToCache); for ($ii = 0; $ii < $objCount; $ii++) { string $caches[] = findExistingCaches($objsToCache[$ii]); for ($cache in $caches) { string $geoms[] = `cacheFile -q -geometry $cache`; for ($geom in $geoms) { string $isFluidShape[] = `ls -type fluidShape $geom`; if (size($isFluidShape) > 0) { if (0 == stringArrayCount($geom,$objsToCache)) { $objsToCache[size($objsToCache)] = $geom; } } } } } if ($showError && 0 == size($objsToCache)) { error((uiRes("m_getFluidObjectsToCache.kFluidSelectError"))); } return $objsToCache; }