// =========================================================================== // 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 bakeFluidAutoResize() { int $start = `playbackOptions -q -minTime`; int $end = `playbackOptions -q -maxTime`; string $fluids[] = `ls -sl -dag -type fluidShape`; string $bake = ("bakeResults -t \""+$start+":"+$end+"\" -simulation true -sac true"); int $hasFluid = false; string $fluid; for( $fluid in $fluids ){ string $lf = ($fluid + ".lastResizeFrame"); if( objExists( $lf )){ $hasFluid = true; $bake += (" " + $fluid + ".resolutionW"); $bake += (" " + $fluid + ".resolutionH"); $bake += (" " + $fluid + ".resolutionD"); $bake += (" " + $fluid + ".dimensions"); string $tforms[] = listTransforms( $fluid ); $bake += (" " + $tforms[0] + ".translate"); } } if( $hasFluid ){ eval $bake; source disableFluidAutoResize; for( $fluid in $fluids ){ disableAutoResizeForFluid( $fluid ); } } else { warning ( (uiRes("m_bakeFluidAutoResize.kNoResizeFluids"))); } }