View Full Version : Painting Fluid through code.

05-20-2004, 04:16 AM
I'm trying to make a mel script so that when rain particles hit my ground mesh they draw little circles in a texturemap which is used to transition the texture from a dry texture to a wet texture.

I have code that works which enables me to do roughly what I want using a 2D fluid, but I'm having trouble making the points larger (or any different size for that matter).

float $colU = particleShape1.collisionU;
float $colV = particleShape1.collisionV;
float $dropSize;
int $indexU;
int $indexV;

if ($colU > 0) {
$dropSize = 25;
$indexU = (float)fluidTexture2DShape1.resolutionH*$colU;
$indexV = (float)fluidTexture2DShape1.resolutionW*$colV;
setFluidAttr -xi $indexU -yi $indexV -at density -ad -fv $dropSize fluidTexture2DShape1;

This code draws a point in the density but increasing $dropSize does nothing from what I can see.

I think (Maybe I'm wrong) I want to emit the "color" but all my attempts to do so ended in failure.

Can anyone help?

CGTalk Moderation
01-18-2006, 06:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.