[Closed] Global variable animation range return wierd value
With the correct node selected, every time I call part of the script:
slidertime = 0
initial = animationrange.start as integer
final = animationrange.end as integer
messagebox(initial as string)
messagebox(final as string)
I get the initial and final values as 0 and 27200. The animation has frames from 0 to 170 and also I checked the time configuration menu which displays correct values. Is there something else I need to set up to get the correct value form the script?
animation range start and end values are Time type values. To get frame value use:
animationrange.start.frame
Maybe a little more details are needed, I’m working with 3dsMax 9 64bit version. I also noticed it doesn’t matter which scene I have loaded, the final value still has a weird random, I never get the correct end time showed in the time configuration window. Next to the time configuration icon, there is a field where you can write frame number, I tried also setting it to 0 and to the last frame (in my case 100) getting the same wrong results.
Hope someone can help me.
I think it is being multiplied by the ticks per frame value, so really you’re getting the tick number not the frame number. You can divide by the ticks per frame value (I think it’s also a global variable)
Thank you lo, I checked the max documentation and found when using 30 FPS there is a default value for the ticks per second; 4800. As result 160 ticks per frame. Dividing by the ticks per frame, as you said works. :applause:
animationrange.start.frame
Oh! that’s even better. Thank you, works.