Is it possible to get the length of the current scene in a driver?

I'm trying to make properties loop, without having to edit the drivers if I change the first or last frame. I'm coming from an After Effects background, so what I want is something equivalent to AE expression's thisComp.duration


1 Answer 1


Just paste this into your driver's field:

bpy.context.scene.frame_end - bpy.context.scene.frame_start

i put it in my x-scale:

enter image description here

Note: works only if your animation is playing.


You must log in to answer this question.

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