// =========================================================================== // 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: 20 Feb 2002 // // Description: // Edit Fluid Resolution // // global proc doResampleFluid( int $version, string $args[] ) { if(( $version < 1 ) || ( size( $args ) < 3 )) { error(uiRes("m_doAppendHairCache.kIncorrectVersion")); return; } int $resX = $args[0]; int $resY = $args[1]; int $resZ = $args[2]; // Make sure that we have a fluid selected // or warn the user and fail string $selectionList[] = `ls -sl`; int $numSelected = size($selectionList); if ($numSelected == 0) { error(uiRes("m_doDeleteFluidsPB.kNoFluidsSelected")); return; } $fluidShape = getFluidShape($selectionList[0]); if (size($fluidShape) == 0) { error(uiRes("m_doExtendFluid.kSelectFluidFirst")); return; } string $cmd; $cmd = "resampleFluid "; $cmd = $cmd + "-rw " + $resX + " "; $cmd = $cmd + "-rh " + $resY + " "; $cmd = $cmd + "-rd " + $resZ + "; "; int $is2d = `getAttr ($fluidShape + ".is2d")`; int $newResX = $resX; int $newResY = $resY; int $newResZ = 1; if(!$is2d) $newResZ = $resZ; if( verifyFluidResolution( $fluidShape, $newResX, $newResY, $newResZ ) ) { $cmd = rebuildFluidInitialStateCmd($cmd, "resampleFluidRebuildIC"); } else { $cmd = ""; } eval $cmd; }