Jump to content

Switch values within a range every second

JP Shep

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
Link to comment
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.

Link to comment
Share on other sites

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.

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...