Notifications
Clear all

[Closed] run out of keys in my array

I’m working on a procedural animation and I’m trying to pull the duration from a previously keyed objects.
Keys_R is an array with the frame numbers

    for i = 1 to (Keys_R.count - 1) do     --        Big barf if [i] undefined    
                  (
                      W_C_L = ( Keys_R[i + 1] - Keys_R[i] )
                  )

When I run
W_C_L = ( Keys_R[i + 1] – Keys_R[i] )

in the Listener window – with values instead of the [i]s – I get the duration between the two keys
but when I run the loop in a script all I get is

OK

Sometimes I feel such a noob :banghead:

2 Replies

The values are calculated properly but you are not telling maxscript to print that value, so all you need to do is add a “print W_C_L” in your loop

antonv
Bingo!

Some days my brain is not on straight :wavey:

Too much :banghead: I guess