Skip to main content
Participant
June 9, 2025
Answered

sampleImage bug (or user error?)

  • June 9, 2025
  • 1 reply
  • 228 views

Hello.

 

I am trying to dyamically return the color value of a text layer based on the color value of the layer underneath its position (which is a video). This is my expression. It is applied to the Source Text of the text layer. All I get is [0,0,0,0] no matter where the text layer is location within the composition.

 

sampleImage(transform.position, radius = [8, 8], postEffect = true, t = time)

 

It is this a bug or ... user error?

 

Evan

 

 

Correct answer Dan Ebberts

If you're trying to sample the layer below the text layer in the layer stack, I'd try it this way

thisComp.layer(index+1).sampleImage(transform.position, radius = [8, 8], postEffect = true, t = time)

:

 

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
June 9, 2025

If you're trying to sample the layer below the text layer in the layer stack, I'd try it this way

thisComp.layer(index+1).sampleImage(transform.position, radius = [8, 8], postEffect = true, t = time)

:

 

Participant
June 10, 2025

Thanks Dan. That did the trick.