PDA

View Full Version : After Effects: Sync an opacity to a background video


manservantpablo
04-25-2012, 08:01 AM
I have this scene, where the lights are flickering wildly in the background from various directions, and I have this cartoon animated on top of it - however I did not animate the flickering lights. I decided to do it in After Effects, so I have dropped the animation into its own comp, and assigned masks to the various parts of the character. I have 3 layers for the character, all duplicated.

One represents the BRIGHT part of the character, the second represents the normal brightness of the character, and the last one represents the shadow.

I am wondering if there is a way to get the pixel information from the FLASHING background video, and have that information translated to the individual layers to adjust their opacities individually, without me having to manually keyframe it?

I am using After Effects CS5, thanks for any help at all!

Mylenium
04-25-2012, 02:53 PM
Sure, a sampleImage() expression is your friend. Though I don't really see the point of your setup. If the lights come from multiple directions and have different colors sampling all of them individually requires just as many "samplers" and they may need additional animation, too, plus the expression code would get complex and slow...

Mylenium

manservantpablo
04-25-2012, 07:24 PM
Sure, a sampleImage() expression is your friend. Though I don't really see the point of your setup. If the lights come from multiple directions and have different colors sampling all of them individually requires just as many "samplers" and they may need additional animation, too, plus the expression code would get complex and slow...

Mylenium

Thanks,

How would you go about achieving the desired effect?

Mylenium
04-26-2012, 08:05 AM
The basic setup is sampleImage(coordinates, sample radius) and then you remap it using a linear() expression to you opacity. example:

sampler=sampleImage([X,Y],[width,height];

linear(sampler,0,1,0,100)

Fill in values as you see fit or tie e.g. the position to a point expression control...

Mylenium

CGTalk Moderation
04-26-2012, 08:05 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.