Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects ADBE Vector Shape Anchor & Position

  • ADBE Vector Shape Anchor & Position

    Posted by Ilya Gusinski on April 8, 2022 at 7:27 pm

    Hello Friends…

    I am trying to figure out something that has been nagging me for years….

    If I create a simple shape layer with a bezier path, the layer itself has an anchor point and position properties, then the shape group itself has its own anchor point and position properties that are relative to the layer, then, if I select/double click on the path itself and the entire path is selected, I can move the path around, move the path’s anchor around, and none of those movements are reflected on the layer and shape group position and anchor properties… so I am looking for a way to access that – either via expression or script so that I can programmatically reset it… but I just can’t figure it out… Funnily enough I can’t even figure out the the nomenclature…. the issue that I am describing, does it affect the vector shape path position or must I call it something else?! can someone point me in the right direction either to how to properly describe the issue and how would be possible to solve it…

    Thanks in advance!

    Ilya Gusinski replied 4 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    April 9, 2022 at 5:32 pm

    Hello Ilya,

    Yes, that can be very annoying and puzzling. Those are the actual coordinates of the vertices.

    a line that goes from [0,0] to [100,0] can look excatly the same as a line that goes from [123,56] to [223,56] but with an adjusted ancorpoint.

    Here’s an expression to manipulate the verteces of a path and “center” them around the average of all the points:

    p=points();
    avgVertex = p.reduce( (prev, cur) => add(prev, cur/p.length), [0,0]);
    p = p.map( el => sub(el, avgVertex));
    createPath(p, inTangents(), outTangents(), isClosed());

    or an expression that moves the whole shape so that the first vertex has coordinates [0,0]:

    p=points();
    firstVertex = p[0];
    p = p.map( el => sub(el, firstVertex));
    createPath(p, inTangents(), outTangents(), isClosed());
  • Ilya Gusinski

    April 12, 2022 at 4:19 pm

    Filip – this is incredible! thank you so very much! – I have been looking for something like that for ages!

    it is always very difficult to figure out which JS functions will and will not work and I never even considered the approach you took!

    Again, thank you!

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