CParticleEvolver Script

From PopcornFX
Jump to: navigation, search

Script evolver Last update: v1.10.0- Main page : Particle evolvers Particle evolvers


The script evolver allows you to run a custom particle script at each evolve step, and virtually implement any custom evolver you'd like.
There can be any number of script evolvers inside the same particle evolver state. They will be each executed in order.


Please see the Script editor page for more information on the edition interface, and the Scripting reference page for details on the syntax.


Script evolver Node properties

The script evolver does not expose any properties.

The node property panel will instead display the list of particle fields instead.

Script evolver properties

Script evolver Node viewer panel

When the script evolver is selected, it will display the Script editor inside the Node viewer panel.


Script evolver panel


Script evolver Pre-declared variables

See the Scripting reference / Evolve scripts page to see what values you can access from an evolve script.


Script evolver Examples

Here is an evolve script that emulates a Physics evolver Physics evolver with simple constant gravity:


It performs the following classic motion computation:

37004.png
37006.png

function void	Eval()
{
	float3	accel(0,-4,0);	// constant gravity. can be read from a custom field or an attribute if needed
	
	Position += Velocity * dt + 0.5 * accel * dt * dt;
	Velocity += accel * dt;
}