[Closed] IsAnimationPlaying ?
Hi all !
I am wondering if there is a way to query the if the animation is playing or not…
Lets say that you create a PLAY/STOP button, you might want to prevent the case where the user presses PLAY on your UI then use the STOP in the 3dsMax UI…
ex :
on btn_PlayStop pressed do
(
if IsAnimationPlaying then
(
StopAnimation()
)
else
(
PlayAnimation()
)
)
Or maybe there is a way to get a callback on the PLAY/STOP button in 3dsMax’s UI …
( sorry for my english )
In max 2008 (or if you have the AVG extension installed), you can use isAnimPlaying(). registerTimeCallback and unRegisterTimeCallback might also be worth looing up in the reference.
Martijn
Well, the problem I see with the TimeChangeCallback is that it can be called even when the animation is not playing ( ex : when scroling the time scroller )
And for the AVG call, I’m trying to find an alternative solution, since I want my tool to stay backward compatible at least to max9 ( currently compatible down to max7 )
Is there any other way ? :shrug:
Well, the AVG tool -is- freely available…
That said… I don’t think there is a way to do that, directly…
But you could set up a timer, perhaps? I.e. if you no longer get a timeChangeCallback event after N milliseconds, consider the animation stopped. And when you do get one, consider the animation to be ‘playing’?
After thinking about it, I think you are right, there is probably something to do with the timechangecallback .
Thanks
Thanks to this I think I might be able to release DViewPaint Beta soon
Just another thought… what if you tracked the position of the mouse. Almost everybody’s scrub bar is in the same place relative to the bottom of the screen… wouldn’t work for everybody… but could catch 95%…
could always have the user define the slider area first
Wouldn’t really help solve whether the user is scrubbing, clicking, or messing with the mouse while playback is on-going, though.