Filling a volume via Python

Discussion about scripting with Python
CMPXCHG8B
Posts: 4
Joined: Wed Mar 22, 2017 7:45 am

Filling a volume via Python

Postby CMPXCHG8B » 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?

-CMPX


User avatar
tsn
Posts: 872
Joined: Fri Oct 27, 2006 10:36 am

Re: Filling a volume via Python

Postby tsn » Wed Mar 22, 2017 2:36 pm

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:

http://www.waterline.tv/downloads_03.html

Cheers,
Thomas

CMPXCHG8B
Posts: 4
Joined: Wed Mar 22, 2017 7:45 am

Re: Filling a volume via Python

Postby CMPXCHG8B » Fri Mar 24, 2017 7:46 am

Wow.

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

-CMPX


Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 2 guests