particleFlow Global Interface

Particle Flow provides the Global Interface particleFlow.

Methods:

<void>beginEdit()

 

<void>endEdit()

Block the Event encapsulation of Particle Flow Actions created via MAXScript.

When a Particle Flow Action (Operator or Test) is created, it is automatically encapsulated into a Particle Flow Event. This is done since all Particle Flow Actions should belong to an Event.

Sometimes this behavior can be undesired and become an obstacle when creating Actions via MAXScript. To avoid this, the pair beginEdit / endEdit can be used.

<node>openParticleView()

Opens the Particle View. Returns the Particle View node.

Example:

--Disable Automatic Event Encapsulation

particleFlow.beginEdit()

OK

--Create a new Find_Target Action

ft = Find_Target()

$Find_Target:Find Target 01 @ [0.000000,0.000000,0.000000]

--Enable Automatic Event Encapsulation again

particleFlow.endEdit()

OK

--Open Particle View and take a look:

pview = particleFlow.openParticleView()

$Particle_View:Particle View 01 @ [0.000000,0.000000,0.000000]

--As expected, Find_Target will not appear inside

--an Event in Particle View

You can use the following short MacroScript to generate an ActionItem that can be placed on a Toolbar, Menu, QuadMenu or Keyboard Shortcut to quickly open Particle View even when there is no PF_Source in the scene.

Sample Script:

macroScript PView_Open

category: "Particle View"

buttontext: "Open PView"

tooltip: "Open Particle View"

(

-- Open Particle View

particleFlow.openParticleView()

)

<node>scriptRunner()

This method is used in PF_Source Every Step Update and Final Step Update scripts to identify the actual PF_Source that is currently running the script.

Example:

pf= particleFlow.ScriptRunner()

<int>getActionOrder()

Get the Particle Flow Action Order.

<void>setActionOrder <integer>order

Set the Particle Flow Action Order.

Possible values are:

0: Globals First - At each integration step, Particle Flow first applies actions in the global event, and then actions in the other (local) events. Typically, the result is that actions in the local events override comparable actions in the global event.

1: Locals First - At each integration step, Particle Flow first applies actions in the local events, and then actions in the global event. Typically, the result is that actions in the global event override comparable actions in the local events

Note:

For predictable results, don't use similar actions in the global and local events. However, if comparable actions do exist in both the global event and other events, Particle Flow applies them to the system in the order specified here. Typically, the effect that's applied last is the one that's visible in the particle system. Default is 1: Locals First.

<int>getUpdateType()

Get the Particle Flow Update Type.

<void>setUpdateType <integer>type

Set the Particle Flow Update Type.

Possible values are:

0 : Complete mode - the whole particle animation is recalculated starting at the first frame.

1 : Forward mode - particles aren't updated right away. At playback time the particle history is not recalculated. Only new events that will happen with the particles have new settings.

Note:

The Update Type determines how Particle Flow updates the system when you change a parameter during playback. Because the state of the particle system at any given frame can depend on events in previous frames, using the Complete option can provide a more accurate depiction of the result of the change, at a cost in speed; it takes more time to recalculate the entire system starting at the first frame. Default is 0: Complete.

 

See also

PF_Source : GeometryClass

Particle Flow Interfaces

Every Step Update Example

Final Step Update Example