PDA

View Full Version : time slider


Hobbs
02-14-2007, 09:47 PM
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?

Wahooney
02-15-2007, 11:28 AM
Just so that I can understand... You want a script that essentially gives your FPS while scrubbing your animation, right?

jonlauf
02-15-2007, 03:25 PM
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
)

Hobbs
02-15-2007, 03:49 PM
Thanks! thats exactly what i was looking for :thumbsup:

CGTalk Moderation
02-15-2007, 03:49 PM
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.