Page 1 of 1

sampleImage() time parameter

Posted: April 6th, 2009, 10:00 pm
by anguschandler
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.

Re: sampleImage() time parameter

Posted: April 7th, 2009, 1:15 am
by Paul Tuersley
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:

Code: Select all

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:

Code: Select all

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.

Re: sampleImage() time parameter

Posted: April 7th, 2009, 2:12 pm
by anguschandler
Thanks.