Jump to content

[SOLVED] trigger every 10th frame


Recommended Posts

hey guys.

simple question which I do not hold the answer to.

I have a switch and I want it to switch input number every 50th frame going between 0 and 1.

so example would be that for the first 50 frames the active switch value is 0 and then on frame 51 it goes to 1, hold that for 50 frames and then turns back to 0.

I need this to be a procedural expression if possible rather than key framing it.

 

Thanks

Edited by Jesper Rahlff
Link to comment
Share on other sites

this expression does it (floor(($F+50)/50)%50)%2

but I'm sure there is an easier one. I even remember a thread here on odforce where I posted the solution but it was a long time ago and I can't find it anymore..

 

EDIT: found it! In your case it would be $F%100<50

So we can say that if you need to turn something on (= 1) every n frames for a certain duration (num_frames_turned_on)
the general form is $F % ( every_n_frames + num_frames_turned_on ) < num_frames_turned_on

 

 

Edited by 3dome
found it!
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...