Jump to content
JP Shep

Switch values within a range every second

Recommended Posts


For a side project I'm working on I'm trying to create random/periodic lighting strikes.

I'm trying to get a line with animated noise on it to increase its length to a set max value, pause for a few frames, return to a length value of 0 then have it hit the max value again after holding its value again.

I have multiple [lines] with different length values (with a point VOP to create the noise)  feeding into a [switch]

I've tried using multiple expressions like floor($F/24) and $F % 2 and a fit range.

I've gotten the values to switch after 24 seconds but not switch back; and to switch back and forth but it does it every frame and it's too fast.  I've also gotten the switch to count up every X seconds (i.e. 1, pause, 2, pause, 3, pause) but not count back down.

Anyone have any ideas?

Edited by JP Shep

Share this post

Link to post
Share on other sites

I thought about it but I wanted to control the switch with an expression rather than keyframe it or motion motion FX

I think I figured it out though.  I have 2 different lines feeding into my [switch] one with a length value of 10 and the other with a value of 0 and then I'm using a pulse expression in my [switch] node to switch between the two values every second.

This is what I'm using right now. pulse($F % 24, 0, 12)  

Right now it's working but I may still need to tweak the values.

Although I'm not sure I can get it to pulse between more than 2 values at the moment.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now