// =========================================================================== // 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: 2000 // global proc string createFluid( int $is2d ) { if( `artFluidAttrCtx -exists artFluidAttrContext` ) { artFluidAttrCtx -e -dsc true artFluidAttrContext; } string $flShad = `shadingNode -asShader fluidShape`; // setAttr -lock yes ($flShad + ".is2d") $is2d; setAttr ($flShad + ".is2d") $is2d; // 2D fluid should show outline by default, but for // a 2D fluid this means Outline, not Bottom. if( $is2d ) { setAttr ($flShad + ".boundaryDraw") 2; setAttr ($flShad + ".resolutionD") 1; } // Use startFrame to make sure that unit conversion happens tastefully // and that attribute editor is up to date setAttr ($flShad + ".startFrame") 1; connectAttr time1.outTime ($flShad + ".currentTime"); string $flSG = `sets -renderable true -noSurfaceShader true -empty -name ($flShad + "SG")`; connectAttr -f ($flShad +".outColor") ($flSG + ".volumeShader"); connectAttr -f ($flShad +".instObjGroups[0]") ($flSG + ".dagSetMembers[0]"); if( `artFluidAttrCtx -exists artFluidAttrContext` ) { artFluidAttrCtx -e -delaySelectionChanged false artFluidAttrContext; } return( $flShad ); }