Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Add an independent expression for SIZE to a child layer.

  • Add an independent expression for SIZE to a child layer.

    Posted by Marko Novkov on June 3, 2019 at 9:03 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

    Kalleheikki Kannisto replied 7 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    June 3, 2019 at 8:19 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy