Using MAXScript in Script Actions

Particle Flow provides the following Script Actions:

Birth_Script : Helper

Script_Operator : Helper

Script_Test : Helper

These Actions can be used to give birth to particles, manipulate their properties and test properties against user-defined values.

Handlers:

All Script Actions implement four handlers to specify the channels used, perform initialization tasks, proceed and perform cleanup works. These handlers are:

on ChannelsUsed pCont do ...

Defines the channels to be made available to the script. The list of all possible channels is available under Interface: MaxscriptParticleContainer.

The parameter passed to the handler contains the Particle Container the script is applied to.

Example:

on ChannelsUsed pCont do

(

pCont.useTime = true --enable the Time channel

pCont.useSpeed = true --enable the Speed channel

pCont.useInteger = true --enable the Integer channel

)

on Init pCont do ...

This hander is called when the Action is being initialized. It can be used to perform preparation tasks like defining variables, creating (limited) additional geometry etc.

For examples implementing the Init handler, see Fragmentation Sample Script and Metaball Sample Script

on Proceed pCont do ...

The Proceed handler is called whenever the Action is evaluated. The handler contains the main script applied to the Particles. In this handler, every particle can be modified by accessing its various properties. For a list of all properties and methods available inside the on Proceed handler, see Interface: MaxscriptParticleContainer

The parameter pCont passed to the handler contains the Particle Container the script is applied to.

on Release pCont do ...

The Release handler is called when the Action is released. It can be used to do cleanup work, but is typically empty.

 

See also

Particle Flow Sample Scripts

Interface: MaxscriptParticleContainer