Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Accesing 1st and 2nd keyframe of a mask from selected layer

  • Accesing 1st and 2nd keyframe of a mask from selected layer

    Posted by Tom Pinnes on December 31, 2020 at 7:01 am

    Hello everyone i just started scripting with ExtendScript ToolKit and i’m in need of some direction.

    I’m trying to write a script that collects the vertices of a mask from the 1st keyframe and 2nd keyframe.

    *Assume the layer is selected and a layer holds at least 2 keyframes and is a rectangle.

    Here is my code so far, it’s lacking the most important part and this is where i need your help 🙂

    var project = app.project

    var currentComp = project.activeItem

    var selectedLayers = currentComp.selectedLayers

    var myLayer = selectedLayers[0]

    var layerIn = myLayer.inPoint

    var layerOut = myLayer.outPoint

    var selectedMask = myLayer.Masks(“Mask”)

    var newMaskShape = selectedMask.property(“maskShape”)

    var newShape = newMaskShape.value

    var shapeVert = newShape.vertices

    /// Find a way to select 2nd keyframe vertices

    Thanks in advance !

    Tom Pinnes replied 5 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 31, 2020 at 7:47 am

    I think what you want instead of newMaskShape.value is newMaskShape.keyValue(1) and newMaskShape.keyValue(2). Also, don’t forget the semi colons at the end of your statements.

  • Tom Pinnes

    December 31, 2020 at 10:44 am

    Hey Dan, first of all i wanna say thanks because you already helped me when i read an answer on another topic 🙂

    Regarding my problem-

    That’s what i was looking for.. .keyValue(1) and .keyValue(2)

    Now it workes great, thanks alot !

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