I have a function which searches for the first key and last key of selected objects. I'm then returning array of time range start, end, first key time, last key time and slidertime.
I'm calling the function inside for loop. Problem is that everything works correctly in the first cycle, but will crash with an error on the second loop (Call needs function or class, got:).
Here is how my script looks like:
fn FindTimeRange =
--some simple stuff finding time ranges, first and last keyframes
-- here I'm "storing" output values into the function
FindTimeRange = #(OrigTimeStart, OrigTimeEnd, CT, MaxTimeStart, MaxTimeEnd)
for I=1 to 3 do
-- running the function and loading it's values into other variable... I think I'm doing something wrong here
TimeRanges = FindTimeRange()
First loop runs ok, but the second loop will crash with this error:
-- Type error: Call needs function or class, got: #(0f, 14f, 14f, 0f, 26f)
In maxscript editor cursor stops on TimeRanges = FindTimeRange()
I'm getting that error even if I manually execute single line which tries to run the function and load it into variable.
I think that I'm doing something wrong with trying to load function into variable part of the script, but can't figure out what it is or what should I do different.
Any help would be appreciated.