Expression: Loop image sequence with $F

   8366   5   1
User Avatar
Member
279 posts
Joined: Dec. 2009
Offline
I would like to loop an images sequence in an expression based on $F.
My images sequence is 5 frames with a padzero of 2 digits.

I put an expression like this:

$HIP/tex/image.`padzero(2,$F/$FPS)`.rat

All works fine but after $F is greater than 5 seconds this expression will give a result of image.06.rat but i would like to restart to image.01.rat

How can i do this in expression ?

Thanks for replies
User Avatar
Member
55 posts
Joined: Sept. 2010
Offline
So you want it to go: 1->5 and cycle? If so you can do ($F % 5) + 1. This will cycle from 1-5.

So your whole expression would be: $HIP/tex/image.`padzero(2,($F % 5 + 1)/$FPS)`.rat
User Avatar
Member
279 posts
Joined: Dec. 2009
Offline
Thanks a lot. It's exactly what i'm looking for.

Except in my case to change frame every second and not every frame,
my expression must be:

image.`padzero(2, ($F/$FPS) % 5 + 1)`.rat
User Avatar
Member
16 posts
Joined: June 2012
Offline
Didnt exactly work for me…
($F % 5) gives me: 1,2,3,4, -> 01234, 01234..etc
($F % 5)+1 gives me: 2,3,4,5, -> 12345, 12345..etc


in a timeshift:
($F-1) % 5 + 1 gives me: 12345, 12345…etc

but thnx for the guidance
Edited by dennisvolkerts - May 9, 2019 14:17:10
User Avatar
Staff
5205 posts
Joined: July 2005
Offline
You need: ($F-1)%5 + 1
User Avatar
Member
16 posts
Joined: June 2012
Offline
twod
You need: ($F-1)%5 + 1
haha yup I already figured it out before seeing your message.
changed my previous post… Thnx for confirming I was wrong!
  • Quick Links