Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

 
anguschandler
Topic Author
Posts: 4
Joined: Sun Apr 05, 2009 3:20 am

sampleImage() time parameter

Mon Apr 06, 2009 10:00 pm

Trying to figure out what kind of input this takes, and what it does with it.

Does it want time in seconds, frames, or timecode? Is it an absolute composition time or is it a time shift, like cloneTimeShift?

Thanks in advance.
 
Paul Tuersley
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Re: sampleImage() time parameter

Tue Apr 07, 2009 1:15 am

With expressions time is always in seconds. And I believe it's absolute comp time. It returns an array of four values i.e. [r,g,b,a] ranging from 0 to 1. The required inputs are in the format:
sampleImage(point, radius = [.5, .5], postEffect=true, t=time)

As a quick test to get you started, add a Point Control and a Color Control effect to a layer, then add this expression to the Color Control property:
sampleImage(effect("Point Control")("Point"),[1,1],true,time);

This will result in a color value, sampled from the position of the Point Control, with a radius of 1 pixel, at the current comp time.
 
anguschandler
Topic Author
Posts: 4
Joined: Sun Apr 05, 2009 3:20 am

Re: sampleImage() time parameter

Tue Apr 07, 2009 2:12 pm

Thanks.

Who is online

Users browsing this forum: No registered users and 3 guests