Skip to main content
Participant
March 25, 2024
Beantwortet

Sample Image to Scale applied to a 3D layer

  • March 25, 2024
  • 1 Antwort
  • 1098 Ansichten

I've created this Gradient Controller

 

https://youtu.be/1UaZNcVobhg?si=c_kJ0Y9vpdnM4kEG

 

but I need to change and apply that expression to 3D shape layers that form the grid (everything same as in the tutorial, only change is that the layer is supposed to be 3D, not 2D). I need to turn on Collapse Transformations on that precomped grid and work with it as a background in the animation where I animate in 3D space, meaning I need those shape layers to be sharp even if I get close to the grid with the 3D camera.

 

I have already checked all those few threads speaking about this problem but I can't get nothing of it to get to work.

 

Every help would be highly appreciated, thank you very, very much in advance

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von Dan Ebberts

I pasted in the wrong expression, but I'm not sure it explains the error you're seeing. Try this and see if it works any better:

target = thisComp.layer("background");
p = target.fromComp(toComp(anchorPoint));
x = target.sampleImage(p, [.5,.5], true, time)[0];
100*[x,x]

Ah. If your background is 3D you might need to do it this way:

target = thisComp.layer("background");
p = target.fromComp(toComp(anchorPoint));
x = target.sampleImage([p[0],p[1]], [.5,.5], true, time)[0];
100*[x,x]

1 Antwort

Dan Ebberts
Community Expert
Community Expert
March 26, 2024

Se

target = thisComp.layer("background");
p = target.fromComp(toComp(anchorPoint));
target.sampleImage(p, [.5,.5], true, time)

e if this does what you want:

Dan Ebberts
Community Expert
Community Expert
March 26, 2024

Sorry that was for color. Try this for scale:

target = thisComp.layer("background");
p = target.fromComp(toComp(anchorPoint));
x = target.sampleImage(p, [width, height]/2, true, time)[0];
100*[x,x]
HotoviAutor
Participant
March 26, 2024

I'm sorry Sir