Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The result is a little bit strange, because we have to deal with a vector. In the messages window you can see something like this:

<RealFlow Vector object at 0xf74218>

<RealFlow Vector object at 0xf74140>

<RealFlow Vector object at 0xf74218>

 

Vectors are coded within RealFlow and if you want to print out the scalars you have to determine the values individually:

...

Now the output is clearly readable:

  • 0.320292592049 / 0.439999759197 / 0.239609465003
  • 0.250641554594 / 0.439999759197 / 0.311735242605

 

The position of the particle.getNextParticle() statement is of special importance. If it is not inserted correctly, the loop will not stop and will RealFlow freeze.

...

Code Block
themeEclipse
languagepython
linenumberstrue
current_particle = all_particles[7] or

current_particle = all_particles[749]

 

The “for … in” and “for … in range” methods are not limited to particles. A list object does not care whether there are particles, objects or vertices stored inside. So these loops can be used with any node, polygon, result and anything else you have inside a list.

...