View Full Version : 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!
|
|
denisT
10-15-2009, 04:17 PM
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!
Let's say we have some particle flow. Let's name it "pf".
pf has to have list of events.
using initialEvents interface we can get this list of events:
actionList = for i=1 to pf.getNumInitialActionLists() collect (pf.getInitialActionList i)
using ActionList interface we can get a list of actions for every event:
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 :)
CGTalk Moderation
10-15-2009, 07:05 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.