Monday, January 2, 2012

A great script at fluid emmissions with particles.

Can't believe it's been just over a year since my last post here. Figured I'd make use of this blog by linking important findings in the Maya world here.
Today I found a script online that lets particles emit fluids on Maya.

I found the script at this address on the Area:

---------------The Script-----------------------------

// get particle position
float $pos[] = particleShape1.worldPosition;
//find out which fluid voxel is at that position.
vector $voxel = `fluidVoxelInfo -voxel $pos[0] $pos[1] $pos[2] fluid1`;
$vX = $voxel.x;
$vY = $voxel.y;
$vZ = $voxel.z;
//get particle velocity
float $vel[] = particleShape1.worldVelocity;
//emit density and velocity in specified voxel.
setFluidAttr -at “density” -ad -fv 5 -xi $vX -yi $vY -zi $vZ “fluid1”;
setFluidAttr -at “velocity” -ad -vv $vel[0] $vel[1] $vel[2] -xi $vX -yi $vY -zi $vZ “fluid1”;


No comments: