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


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.