Page 1 of 1

Filling a volume via Python

Posted: Wed Mar 22, 2017 7:53 am
Greetings to all!

How can I fill a volume with particles in Realflow via Python?

I'm trying to simulate some rain splashing on a surface. The problem is that I need to create the particles in large globular clusters with an initial velocity. It seems like the spherical particle emitters with "Fill sphere" set to true create the kind of shape and effect I want, but unfortunately this seems to be a one-shot deal. I need to randomly move an emitter around the scene while occasionally filling it with particles, before moving the emitter elsewhere and repeating the same process.

How can I achieve this via the Simulation Flow panel and a Python script? Moving the emitter around seems easy enough- I just don't know how to command it to fill itself with particles at will. Calling setParameter("Fill sphere", True) and setParameter("Fill sphere", false) doesn't seem to work. I guess I could add the particles manually to the scene with addParticle(), but I don't think that respects the resolution of the domain nor would it create spherical volumes in the same of an emitter (inheriting that emitter's scale and position) unless I calculate the particle positions by hand.

TLDR; I'm trying to spawn filled spheres of particles at will. What's the best way to do this in Python?


Re: Filling a volume via Python

Posted: Wed Mar 22, 2017 2:36 pm
by tsn
Maybe you want to take a look at my waterline magazine's "Splashes and Tendrils". It's 100% free and contains exactly what you're looking for:


Re: Filling a volume via Python

Posted: Fri Mar 24, 2017 7:46 am

That's awesome, and exactly what I was looking for. Thanks!