Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  ObiFluidPropertyColorizer
#1
Hi,

I am trying to use ObiFluidPropertyColorizer which is a sample script that colors fluid particles based on their vorticity (2D only). However, vorticity returns always zero. Actually, it's not. I think there's a problem with taking data correctly;

float v = emitter.Solver.userData[emitter.particleIndices[i]][0];

What does zero here (emitter.particleIndices[i]][0]) mean? Does the zero channel give vorticity? I have tried to change it to different values, but get no data. Actually, I am trying to get particles colored according to (density-restDensity)/1000.0f). Is this possible?
Reply
#2
Hi, I indeed need particle densities, not rest density. However, my older script doesn't work with the latest Obi Fluid Build. So, how can make this line work?

float density = e.densities[emitter.particleIndices[i]];


Because "ObiSolver.ObiFluidEventArgs e" is no more available Triste


void Solver_OnFluidUpdated (object sender, ObiSolver.ObiFluidEventArgs e)

I really need urgent help, thanks for your support.
Reply
#3
(27-03-2019, 01:29 PM)mimarilker Wrote: Hi, I indeed need particle densities, not rest density. However, my older script doesn't work with the latest Obi Fluid Build. So, how can make this line work?

float density = e.densities[emitter.particleIndices[i]];


Because "ObiSolver.ObiFluidEventArgs e" is no more available Triste


void Solver_OnFluidUpdated (object sender, ObiSolver.ObiFluidEventArgs e)

I really need urgent help, thanks for your support.

Hi,

All particle properties can now be directly accessed from the solver. Densities in particular are stored in the "fluidData" array of the solver, so you can do:

Code:
float density = emitter.Solver.fluidData[emitter.particleIndices[i]][0];

kind regards,
Reply
#4
(27-03-2019, 09:47 PM)josemendez Wrote: Hi,

All particle properties can now be directly accessed from the solver. Densities in particular are stored in the "fluidData" array of the solver, so you can do:

Code:
float density = emitter.Solver.fluidData[emitter.particleIndices[i]][0];

kind regards,

Thank you!
Reply