YOUR ACCOUNT

Login or Register to post new topics or replies
Bocote
Bocote
Posts: 13
Filters: 3
Hi folks. I've been using FF for a couple years now and most recently I've gotten into processing video.

I've been trying to write a map script that will randomly change the global VARIATION of a filter automatically so each time I run certain filters the results will be different (independent of user input).

I've searched the forum already and I think I need to focus on the prepare function. Below doesn't work, but perhaps someone can help. Thanks

function prepare()
VARIATION = math.random (1, 100)
end;
Bocote
  Details E-Mail
CFandM
ForgeSmith

Posts: 4761
Filters: 266
I can't really help you on the scripting part but what I have played with and used from time to time for animation purpose was the Real-World clock example.
Real World Clock
Stupid things happen to computers for stupid reasons at stupid times!
  Details E-Mail
Bocote
Bocote
Posts: 13
Filters: 3
Thanks CFandM. That clock example is super; if I need a randomseed that will work perfect, but I'm still havent made progress with the variation.
Bocote
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
My thoughts:

I am pretty certain that the global VARIATION is a read-only variable and you can't change it with a script.

I can think of two ways to approach this. Both will only generate random grey values, so you will have to construct your filter accordingly. (Meaning, you can't affect grey control component inputs, but will have to construct a similar effect fr om a green component input.)

The first one is to query the system time with an unsafe script and generate the input values that way. I gather this is what you already tried. The lim itation with that approach is that you get a different value only if the filter is applied with an interval of more than 1 second.

The second one is to pick the value(s) from the input image. With video, you should have varying values for each frame. If you pick, say, the center point gray value, you get 256 variations or if you pick RGB values, you can get 256*256*256 different values, etc.
  Details E-Mail
Bocote
Bocote
Posts: 13
Filters: 3
Thanks ThreeDee. I tried a couple different things and have made some progress. I'll report back if success.
Bocote
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,711 Registered Users
+18 new in 30 days!

153,533 Posts
+38 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

17 unregistered users.