PDA

View Full Version : IsAnimationPlaying ?


EricDLegare
06-07-2008, 05:25 PM
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 :( )

magicm
06-07-2008, 05:42 PM
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

EricDLegare
06-07-2008, 06:15 PM
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:

ZeBoxx2
06-07-2008, 09:55 PM
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'?

EricDLegare
06-07-2008, 10:44 PM
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'?

This is my problem :(

What if the user moves the time slider back and forth ?

EricDLegare
06-07-2008, 10:52 PM
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 :P

Thanks to this I think I might be able to release DViewPaint Beta soon ^_^

thatoneguy
06-07-2008, 11:21 PM
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%...

ZeBoxx2
06-08-2008, 12:52 AM
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.

CGTalk Moderation
06-08-2008, 12:52 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.