Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Dynamics / Emit fluids from particles?
  RSS 2.0 ATOM  

Emit fluids from particles?
Rate this thread
 
41492
 
Permlink of this thread  
avatar
  • Killa-B
  • Posted: 05 April 2010 10:49 AM
  • Total Posts: 5
  • Joined: 01 February 2009 06:57 PM

HI, I am new to Maya and I was wondering if it is possible to emit a fluid from a particle? I am trying to make a realistic flamethrower. I got the flame part down but i can’t make it “throw” correctly. Any help would be great. thanks



Replies: 0
avatar

as far as i know there is no integrated way in Maya to use particles as a fluid emitter.
I think you can script it though, but it will get really slow.

Look up the mel commands:
fluidvoxelInfo // Feed in the Particle Position and a radius und it will return the index of the voxels where the particle+radius is located.
for example: $emitVoxelMove = `fluidVoxelInfo -cb -r $radius -v ($pos.x) ($pos.y) ($pos.z) fluid1`;

setfluidattribute // use the resulting indexes to give the voxels certain amount of density or temperature or whatever.
for example: setFluidAttr -attribute “density” -fv $densityAmount -xIndex $emitVoxel[($a*3)] -yIndex $emitVoxel[(1+$a*3)] -zIndex $emitVoxel[(2+$a*3)] fluid1;

Don’t know if it helps you but maybe it is worth a try.
good luck



Replies: 0
avatar
  • Killa-B
  • Posted: 09 April 2010 02:15 AM

Thank alot for the help. I did some research and found this code and a video of what i want:

// 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”;

so you have the right idea. unfortunately for me I just started using expressions so everything i found and you wrote makes no sense to me, lol. I guess im getting ahead of myself. Im downloading books on mel and expressions so I should get up to speed soon. thanks.



Image Attachment Video
Replies: 1
/img/forum/dark/default_avatar.png

hi, i am also a beginner to scripts could u plz lemme me know that script that u have used for making flame thrower how it is applied or used to find exact position of particles with fluids particles becuase i am also working on it and u have brought much better effect.

Author: priya19

Replied: 05 July 2010 07:19 PM  
avatar
  • tpalamar
  • Posted: 09 April 2010 08:59 AM

You can now emit fluids from nParticles in Maya 2011.



Todd Palamar
http://www.speffects.com

Replies: 0
avatar

Yes I’m really looking forward to the new fluid possibilities of Maya 2011 :)

Still, our current project uses maya 2009 and the workaround with the Mel commands is too heavy for my computer.I wonder how long the flamethrower from the video simulated

hope it works for you killa!
greetz
mr



Replies: 0