WindTunnel script deconstruction HELP

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  10 October 2005
Angry WindTunnel script deconstruction HELP


I'm doing a dvd with some complex fluids expressions. Having a very basic understanding of MEL right now, cannot fullly understand the teachings of the lessons.

Trying to get some pratice on the examples that ship with maya6.5 via Fluid Effects>Get Fluid Examples>

Was hoping someone could help me with the Q & A's.... expression reads:
Quote: float $vel = windTunnelShape.windSpeed;
int $tracers = windTunnelShape.tracers;
int $yres = windTunnelShape.resolutionH;
float $density = 3.0;
setFluidAttr -at velocity -xi 0 -vv $vel 0 0 windTunnelShape;
int $i;
for($i = 0; $i < $tracers; $i++ ){
int $yIndex = (float)$yres *(((float)$i + 0.5)/(float)$tracers);
setFluidAttr -at density -xi 0 -yi $yIndex -fv $density windTunnelShape;

The "resolutionH" is defined as "Resolution of the grid - height". Besides the varialbe $yres, can I control the "resolutionH" buy going into the attribute editor and changing the value in the "Resoluiton Y" field? Is the "Resolution Y" field defined as the "resolutionH"?

Much Thanks
  10 October 2005
Yes, it's a bit confusing and also a bit inconsistent imo to name the resolution of the fluid as length, depth, and height, when you want to make it fit into a coordinate system.

But, yes, the resolutionH is the resolution attribute of the fluid in the y-direction. This attribute connects into the expression directly through the line int $yres = windTunnelShape.resolutionH; so changing the resolution attribute of the fluid in the attribute editor or channel box will feed the new value into the expression immediately and change its output. That's the beauty of expressions - they combine the power and stability of connecting attributes in the dependency graph with the power and versatility of mel.
  10 October 2005

Thanks for responding ,now that I've got that cleared up.....onward.

Quote: setFluidAttr -at velocity -xi 0 -vv $vel 0 0 windTunnelShape;
int $i;

velocity -xi 0 // set the velocity in the X index to a value of 0.

I don't understand where the "X index" is located via 2d/3d container(s).
Is it the voxels only in the X direction or just the first row of voxels or something else. What/Where exactly is the X index in regards to the container?

Appreciate any input on this
  10 October 2005
Thumbs up

I have never used this maya feature but I do know about voxels.

The velocity probably doesn't have any relationship with the fluid container. The voxels only describe the information within the container, and the container is a shoebox region of what 3d space to fill with voxels and define boundaries of the simulation.

Since we are talking a velocity, I bet it's in worldspace
Check it out and let me know what you find.

  11 November 2005
The help docs pull the same old info about xIndex.

Don't see any relation to world space

  11 November 2005
The x index is the index for the voxel along the local x-(length-) axis of the fluid container. I.e. if you have a 10 x 10 x 10 voxel fluid and look at the container with its z axis pointing away from you, index 0 0 0 is the bottom, leftmost and closest voxel, while index 9 9 9 is the top, rightmost and farthest voxel. the line

setFluidAttr -at velocity -xi 0 -vv $vel 0 0 windTunnelShape;

sets the velocity of all the voxels on the first YZ voxel plane (or the first Y voxel column in the ) to a value of $vel (which in turn is fed from the custom attribute windSpeed) in the fluids local x-direction.

By only supplying the x-index in the command, that value is set for all the voxels in the other axes.
  11 November 2005

Appreciate your detailed explaination.

Took me a couple mornings to rap this code around my head before it made sense.

If I made a container, added some attributes (windspeed, tracers), wrote the epression. Would that be enough? Or do I have to connect some nodes (windspeed, tracers to container) in the connetion editor?

I'll try it and see what the heck happens.....

  11 November 2005
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:56 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.