Page 1 of 1

Help using Random

Posted: December 5th, 2007, 9:55 am
by oBe
Greetings noble enhancers,


I'm a bit of a self-educated After Effects fanatic and only recently discovered the lovelyness that is "expressions". I'm usually a bit afraid of all things code, but expressions are just amazing. I still have a long way to go though, because I mostly just wiggle a lot.

Now, I'd like to create an effect, and I would like some help, as I can't get it to work like it should.

I have a 3D scene, a landscape with mountains and trees, and I'd like to have it flash in pure black and white, like a Sin City style lightning.

So I set up an animation preset:
1) Saturation:0
2) Contrast: 100

3) And I guess I need a Invert with a random expression, setting the blending with original being either 0 or 100, but I'm not to sure how to set up that to begin with.

Code: Select all

x=random(1,100)
x<1>99
just gives me x<1
I do this because I want the parts that become black, alternating with white and vice versa. So, when the landscape and trees flash black, the sky flashes white.

And then I suppose I'd to make all these happen at the same time, but at random points in my timeline, and though it sounds easy, I'm not too sure if it's even possible.

Any thoughts?

Posted: December 7th, 2007, 3:27 pm
by lloydalvarez
you want your image to invert randomly?

here's an example of randomly animating opacity to make a flicker, maybe you can get some clues from there:

viewtopic.php?t=93

-Lloyd

Posted: December 8th, 2007, 8:30 am
by oBe
Ah, someone cares, excellent!

This is at least half of what I needed, perhaps I more.

I thank you.

Posted: December 8th, 2007, 9:23 am
by lloydalvarez
I am no completely clear from your example what you are trying to do so if you explain it a bit more I might be able to help you out some more.

-Lloyd

Posted: December 8th, 2007, 10:03 am
by oBe
Ah great.

Now, your expression does what I want perfectly. Except now, I'd like to have the entire animation preset (saturation, contrast, invert with wiggle) to flicker on and off.

My best guess for now would be to place a duplicate over my original comp, a duplicate with the invertexpression, and wiggling that opacity, but I'm thinking it could be more simpler. Any ideas?

Also, my compliments on your website. The BG renderer is now my new favourite thing.

Posted: December 8th, 2007, 10:50 am
by lloydalvarez
One idea would be to put the animation preset on an adjustment layer and flicker the opacity of the adjustment layer. Would that achieve the effect you are going for?

-Lloyd

Posted: December 8th, 2007, 11:03 am
by oBe
Not really, as the original comp is precomposed a couple of times, and the flickering one is within it. Not sure of all this makes much sense. But I'll just try the duplicating thing for now.

Also, BG renderer performs better then the "real" one.

Thanks a lot man.

EDIT:
I used a an adjustmentlayer, rendered it out, made it invisible, and overlayed the video over the endresult.

Mission succesfull.