ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Add an independent expression for SIZE to a child layer.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marko Novkov
Add an independent expression for SIZE to a child layer.
on Jun 3, 2019 at 9:03:51 am

I have shape layers parented to Null object so the can move over X axis. (2D)
During the move, I need them to change their size based on the following expression.
This only work when my shape layers are not parented. How can I make it work while parented?

Thank you so much!

sourceLayer = thisComp.layer("Control Layer");
sampleSize = [1,1];
samplePoint = transform.position;
colour = sourceLayer.sampleImage(samplePoint,sampleSize);
x=colour[0]*100;
[x,x]


Marko


Return to posts index

Kalleheikki Kannisto
Re: Add an independent expression for SIZE to a child layer.
on Jun 3, 2019 at 8:19:41 pm

Instead of samplePoint = transform.position; you need the world position of a parented object. The code can be found by searching this forum.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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