Notifications
Clear all

[Closed] time slider

Would it be possible to determine how fast the time slider was being translated? Perhaps using a “mouse down” loop.

I ask because i usually check my animation timing by scrolling the time slider, and it would be nice to have a rollout that told me how fast i was scrolling, or how much i would have to scale my frames to achieve such a timing. If this makes any sense.

Does anyone else do this?

Would this be possible to achieve in maxscript, and could anyone give me a point in the right direction?

3 Replies

Just so that I can understand… You want a script that essentially gives your FPS while scrubbing your animation, right?

The first number displays the current fps and updates every half second, the second number shows you the your average fps over the last two seconds.

(
 local val = 0
 local frameArray = #()
 local fpsArray = #()
 rollout fpsCounter "FPS Counter"
 (
 
 	timer myclock interval:500
 	label curFps "fps" across:2
 	label timing "0.0"
 	label avFps "average" across:2
 	label average "0.0"
 	
 	on myclock tick do
 	(
 		val = currentTime
 		append frameArray val
 		local fpsAv = 0
 		local t = frameArray.count
 		if t >= 2 then 
 		(
 			if frameArray[t] > frameArray[(t - 1)] then
 			(
 				fps = (((frameArray[t] - frameArray[(t - 1)])*2) as float)/160
 				timing.text = (fps as string) + " fps"
 				append fpsArray fps
 			)
 		)
 		
 		if fpsArray.count >= 4 then
 		(
 			for i = fpsArray.count to (fpsArray.count - 3) by -1 do
 			(
 					fpsAv += fpsArray[i]
 			)
 		
 			fpsAv = fpsAv/4
 			average.text = (fpsAv as string) + " fps"
 		)
 	)
 )
 createDialog fpsCounter
 )

Thanks! thats exactly what i was looking for