Particle script operators

5 votes
Version: 
1.0
Date Updated: 
09/17/2014

 


Two script operators for pFlow.

Electric trails (script operator):
Particles move along the edges of a mesh, when they reach a vertex they choose a random edge to go along.
Second version added, which will choose only directions within an angle of a given vector.
A pFlow preset can be downloaded to get a fully working simple setup.
Since the script operator sets the speed of the particles, and detects when a particle is at a vertex, a small script is attached to get the best settings for a mesh.
If you want to change the settings, open up the script operator, and the two settings are at:
line 78 ( testResult = onPoint pCont.particlePosition database 0.5 ) (detection radius)
line 105 ( pCont.particleSpeed = newVector*0.01 ) (speed)

Spawn on edges (birth operator):
Particles spawn on the edges of a mesh, spaced equally based on a distance.
If you want to change the distance, open up the script operator and the distance is at line 15:
pSpacing = 3.0

Additional Info: 

Electric trails:
I recommend setting the particle integration step (pf source, System management, Integration step) to frame for both viewport and render. If it isn't, a particle can change course multiple times per frame.

Spawn on edges:
I'm new to script operators, so if you want to spawn the particles at a frame other then frame 0, you are going to have to change the code. Sorry.

Both scripts require an Editable_poly in the scene called "$Particle_surface" (Electric trails), and "$Particle_Spawn_Object" (Spawn on edges).
If there are any problems, please say, I have very little experience with using script operators so there are probably many faults with both.

Videos below show what electric trails does. Both are using a geosphere, the ones which leave the surface are because some of the edges are longer then others, which allows particles to jump past a vertex. The second video is the direction version, which only allows particles to go along edges within 90° of [0,1,0], which is why they group up.

Video URL: 
AttachmentSize
Electric_trails4.29 KB
Electric_trails_Direction4.9 KB
Spawn_on_edges990 bytes
Electric_trails_Math1.91 KB
Electric_trails_Preset332 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
brttd's picture

Added new version of electric trails.

Added a edited version of electric trails, which will only allow the particle to choose edges within an angle (90° by default) of a given vector.

Michele71's picture

Thanks for this nice script!!

Thanks for this nice script!! +1 also for me :)

barigazy's picture

...

I have nothing to say. Just "COOL"! +1
Great work.
Cheers!

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.