[MAXScript] Get Event by index or key
#1
Lightbulb 
Hi there,

I'm trying to get some attributes from a tyFlow event with maxscript.
Before reaching these attributes, I have to get the event itself, and the only way I found is to use the event's name in tyFlow object's attributes. For instance, to get an Export Particles tyCache Filename :


Code:
myEvent = $tyFlow001.Event_006
myFilename = myEvent.Export_Particles.tycacheFilename

This method supposes that I know the event's name, which is not always the case.
Is there any way to get an array of all the events and use an index or key to get the wanted event ? It would be useful for iterating over the events without having to know there names.

For example with the array's usage, to get the Bend modifier from Box001 object :
Code:
boxModifiers = $Box001.modifiers
bendModifierByKey = boxModifiers ["Bend"]
bendModifierByIndex = boxModifiers [1] -- if the Bend modifier is in first position

The equivalent of this feature in tyFlow would be :
Code:
myEvents = $tyFlow001.events
n = $tyFlow001.numEvents
eventByKey = myEvents["Global Export"]
latestEvent = myEvents [n]

The feature could help a lot for iterating over events proceduraly.

Cheers.
  Reply


Messages In This Thread
[MAXScript] Get Event by index or key - by obeyfx27 - 06-11-2021, 11:05 AM

Forum Jump: