View Full Version : how to emit fluids from nParticles?
kdronez 03-20-2009, 06:22 PM Hi,
I searched over the internet for this but didnt find anything.So my question is how can I make my nparticles to emit fluid particles when they get inside fluid container?
I found one solution,but I dont think that is good.So the thing that I try was to convert this nparticles to polys and after that to make emission from the surface.It actualy work,but it slows my system alot so is there other way to do it,with MEL or smth?
|
|
Phlok
03-23-2009, 12:41 PM
Hi,
I haven't got the time to look up the commands, but it should work the following way:
- Check wicht Voxel(s) your particles is passing.
- Add (e.g.) density at the voxel's position.
kdronez
03-23-2009, 01:29 PM
Hi,
I haven't got the time to look up the commands, but it should work the following way:
- Check wicht Voxel(s) your particles is passing.
- Add (e.g.) density at the voxel's position.
Thx man I knew that it will be with MEL :>.Will check for the commands :>.
Olegr
03-23-2009, 02:05 PM
Check this thread:
http://forums.cgsociety.org/showthread.php?f=86&t=250802&page=1&pp=15
kdronez
03-23-2009, 04:51 PM
Check this thread:
http://forums.cgsociety.org/showthread.php?f=86&t=250802&page=1&pp=15
Wow thx just the thing that I need :>.Its time for reading :>.
Aikiman
03-25-2009, 09:28 AM
vector $pos = particleShape1.position;
int $voxels[] = `fluidVoxelInfo -v ($pos.x) ($pos.y) ($pos.z) fluid1`;
if (`fluidVoxelInfo -ib ($voxels[0]) ($voxels[1]) ($voxels[2]) fluid1`) {
setFluidAttr -at "density" -fv 1 -xi $voxels[0] -yi $voxels[1] -zi $voxels[2] fluid1;
}
This code pretty much simplifies that whole thread.
Olegr
03-25-2009, 10:25 AM
As long as you are simplifying things could you also tell me where to plug this script in? :)
kdronez
03-25-2009, 11:38 AM
As long as you are simplifying things could you also tell me where to plug this script in? :)
I think its expresion that you have to write in expression editor,but 1st you have to set it to "Runtime before Dynamics".
Thx all it works preaty good :>.
Olegr
03-25-2009, 11:51 AM
This is what I tried to do. Keep getting this error:
// Error: Attribute of a particle object can only be used with dynExpression command: position //
kdronez
03-25-2009, 12:17 PM
This is what I tried to do. Keep getting this error:
// Error: Attribute of a particle object can only be used with dynExpression command: position //
Its work for me and this is what I did:
1: Made particle emitter and 3d fluid container.
2: Go to Per Particle Attributes and right click on position->Runtime expression before Dynamics...
3: Paste the code and hit edit :>.
Have to work now :>.
This is pic (http://img106.imageshack.us/my.php?image=76804199.jpg) of the result
Edit: Probably you use nParticles :>.To make them work just change
vector $pos = particleShape1.position; to vector $pos = nParticleShape1.position;
and it will work :>.
Hope this will help you :>.
Olegr
03-25-2009, 12:35 PM
That worked. Thanks a lot.
vector $pos = particleShape1.position;
int $voxels[] = `fluidVoxelInfo -v ($pos.x) ($pos.y) ($pos.z) fluid1`;
if (`fluidVoxelInfo -ib ($voxels[0]) ($voxels[1]) ($voxels[2]) fluid1`) {
setFluidAttr -at "density" -fv 1 -xi $voxels[0] -yi $voxels[1] -zi $voxels[2] fluid1;
}
This code pretty much simplifies that whole thread.
:surprised wow man....
amazed
-J
CGTalk Moderation
05-22-2009, 06:33 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.