FORUMS: list search recent posts

sampleImage Offset

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Daniel Chang
sampleImage Offset
on Sep 7, 2016 at 2:31:04 am

This is the expression:

sourceLayer = thisComp.layer("Control Layer");

sampleSize = [1,1];

samplePoint = transform.position;

colour = sourceLayer.sampleImage(sampleSize,samplePoint);

x=colour[0]*125;

[x,x]


Expected Behavior: Assets scale to 125% when directly on top of white areas. The animation is symmetrical. Refer to this animation.

Reality: The scaling is offset. Scaling is magnified and seems to be anchored at the bottom right corner.







I understand that the sample point has nothing to do with the actual layer position because the layers may not be comp sized and thus the coordinates don't match, but I'm not sure how to adjust the expression code.

Here is the project file. How can this issue be fixed?

Thanks,
Daniel


Return to posts index

Walter Soyka
Re: sampleImage Offset
on Sep 7, 2016 at 9:55:15 am

[Daniel Chang] "Reality: The scaling is offset. Scaling is magnified and seems to be anchored at the bottom right corner."

Scaling happens about the anchor point. It sounds like the layer's anchor point is positioned at the bottom right corner.

You can use the Pan Behind tool to slide the anchor point without moving the layer. You could also write expressions for the anchor point and position to set them how you like. More on anchor point and the Pan Behind tool here:
https://helpx.adobe.com/after-effects/using/layer-properties.html#layer_anc...

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Daniel Chang
Re: sampleImage Offset
on Nov 7, 2016 at 5:25:24 pm

Hi Walter,

Thanks!

Daniel


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]