Notifications
Clear all

[Closed] PFlow operator on/off

Hi,

I would like to know how can I turn on/off PFlow operators like…

Event01 > Shape Instance 01 = off
Event01 > Shape Instance 02 = on

Event01 > Material A = on

I’m max script noob so it would be nice to have full line of code as example

Thanks!

2 Replies

Let’s say we have some particle flow. Let’s name it “pf”.
pf has to have list of events.
using [color=yellow]initialEvents interface we can get this list of events:[/color]


actionList = for i=1 to pf.getNumInitialActionLists() collect (pf.getInitialActionList i)

using [color=yellow]ActionList interface we can get a list of actions for every event:[/color]


actionsByEvent = for ev in actionList collect 
(
  for i=1 to ev.numActions() collect (ev.getAction i)
)

To activate(turn on)/deactivate(turn off) any event you have to find this event (by name?) in the actionList and:


ev.activate on -- activate
ev.activate off -- deactivate

to activate/deactivate any action you have to find this action (by name?) in the actions of “parent” event and using its index in the list:


ev.activateAction index on -- activate
ev.activateAction index off -- deactivate

If all events of your particle flow have unique names you can use pathname to get this event:

If event’s name is “Event 01” –

 
pf.Event01
-- or
pf.Event_01
pf.Event_01.activate on
pf.Event_01.activateAction index on

for more information see MXS help -> Particle Flow Interfaces -> ActionList and initialEvents

Thanks Denis for informative reply! Have to try tomorrow