currentTime on spinner

Hi guys

I have an issue to get the currentTime in real time while playing an animation in a spinner.

I can easily get the CurrentTime in a spinner like this:

spn_CT.value = currentTime

but this way it's not in real time while playing an animation.

If anyone have an idea, thanks a lot :)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
SugaR's picture

What I want is to get every

What I want is to get every frame number you go trought in the spinner while playing an animation.
for exemple, if you have an animation range of 25 frames that begin at frame 0, I want my spinner to show 0,1,2,3,4,5,6....23,24,25 while playing the animation, like the timeslider.

barigazy's picture

...

I love to connect spinner and timeslider like this

try(destroyDialog ::testRoll)catch()
rollout testRoll "• • •"
(
	spinner spn_CT "" pos:[5,5] fieldwidth:80 type:#integer
	timer timeTick interval:30
	on spn_CT changed val do
	(
		if (case1 = val < animationRange.start.frame) or (case2 = val > animationRange.end.frame) then 
		(
			val = if case1 then animationRange.start.frame else animationRange.end.frame
		)
		else slidertime = val
	)
	on timeTick tick do
	(
		if spn_CT.value != sliderTime do spn_CT.value = sliderTime
	)		
	on testRoll open do timeTick.active = on
	on testRoll close do timeTick.active = off
)
createDialog testRoll 100 25 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

barigazy

SugaR's picture

Thanks a lot barigazy,

Thanks a lot barigazy, exactly what I need :)

barigazy's picture

...

If you need advanced solution see this tool and check out "Tune" tab.
You can find playback controls

barigazy

SugaR's picture

Thanks I'm gonna check

Thanks I'm gonna check this.

I didn't know the timer UI, but if I try to understand what you did, you have connected the value of the spinner to the timer, so the spinner change its value every 30 miliseconds according to the sliderTime ?

barigazy's picture

...

Yup :)

barigazy

SugaR's picture

I really need to thank you

I really need to thank you again, the timer is really useful. You just changed the whole way i'll script with mxs ^^

barigazy's picture

...

My pleasure.
BTW using callbacks are good way to monitor something but only if you know to work with them. But timer is very easy to use and control, also when you play with .net stuffs then .net timer will save your life :)
Cheers!

barigazy

SugaR's picture

Ok good to know :) But for

Ok good to know :)
But for now I really don't like to use callback and .net since I don't understand them ^^ (and I read that .net has been badly integrated in max...)

Otherwise, any idea how to open the time configuration dialog via MXS ?

barigazy's picture

...

Who told you that .net is bad implemented in max?
Maybe python but .net is long time here and you can do awesome "magic" stuffs with it.

--open the time configuration dialog
max time config

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.