Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to link shape object ‘paths’ but minus x pixels

  • Expression to link shape object ‘paths’ but minus x pixels

    Posted by Lance Clayton on April 10, 2014 at 1:27 am

    Hi,

    I need the correct expression to link the paths of two shape layer shapes, but such that one is x pixels smaller than the other, thus creating in inner and outer box as in the example pick.

    I want to move the path of only one of the shapes (when reshaping box) and have the other move also, keeping the same separation of n pixels.

    If I simply scale the shape objects when parented then the width of the stroke obviously changes which isn’t desirable.

    I tried something like:

    ON THE SHAPE LAYER PATH TO BE THE CHILD –

    base=thisComp.layer(“BASE”).content(“Shape 1”).content(“Path 1”).path;
    [base[0],base[1]]-[3,-3]

    …but my understanding of the array coding mathematically is wrong.

    Any guidance would be good. Thanks

    Brian Charles replied 12 years, 4 months ago 4 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 10, 2014 at 6:45 am

    I don’t think there’s any way to do math on a path shape. I think valueAtTime() is the only tool in the toolbox, and I don’t think it helps for your situation.

    Dan

  • George Goodman

    April 10, 2014 at 1:12 pm

    I’m sure Dan is right about the expression. But what if you precomposed it, duplicated it, scaled one down, and then generated a stroke on the smaller precomp so that it matched the sizing of the other? Might not be perfect, but could potentially work.

    “|_ (°_0) _|”

    Sincerely,

    George

  • Brian Charles

    April 10, 2014 at 6:00 pm

    I’ve linked 2 shape layers with a couple of sliders and a simple expression here, this may work for you.

    Here’s a CS6 version of the file:

    7356_shapelinked.aep.zip

    ….And another version with the shapes in a single layer grouped.

    7357_boxshapegroup.aep.zip

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