1
$\begingroup$

I want to know how I can access the animation runtime fps from python to display it in the console.

enter image description here

$\endgroup$
0

1 Answer 1

3
$\begingroup$

The last time I looked at this there was no way to directly get the value directly from a property of the API.

You can emulate it with a frame change handler, here is some test code that prints the approx fps to console.

import bpy
import time

t0 = -1
def timer(scene):
    global t0
    t1 = time.clock()
    fps = scene.render.fps  / scene.render.fps_base
    ms = 1000 * (t1 - t0)
    fps = min(fps, (1000 / ms))
    print("FPS:", fps)
    t0 = t1

bpy.app.handlers.frame_change_post.append(timer)
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .