Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Puppet Pin selection via Script

  • Puppet Pin selection via Script

  • Arne Münch

    March 8, 2021 at 8:31 am

    Hi There

    var actItem = app.project.activeItem;

    var selLayers = actItem.selectedLayers;

    var selProps = selLayers[0].selectedProperties;

    var upperP = selProps[4];

    var lowerP = selProps[3];

    var handP = selProps[2];

    I try to select specific puppet Pins via script.

    But it seems that the order of the selection is not taken into account, instead how the pins are arranged in the effect panel.
    Is there a way to address the specific selected pins, for example address the first selected pin?
    thanks so much

  • Arne Münch

    March 8, 2021 at 7:29 pm

    I hoped I could edit my post, but I can’t
    I think I was not clear.
    Its just this: When I address selected layers via script, I can simply address for example the layer I selected first by “selectedLayers[0]”

    This doesn’t seem to work for properties.
    “selectedProperties[0]” doesn’t give me the first selected property, but the first one in the hierarchy.

    Is there a way to achieve that?

  • Dan Ebberts

    March 8, 2021 at 8:23 pm

    As far as I know, the selection order is not accessible for properties.

    I don’t know if this helps, but you can rearrange the stacking order by dragging the pins so that your first selected pin is at the top of the stack.

  • Arne Münch

    March 8, 2021 at 9:04 pm

    thanks, good to know.
    Just to make it clear. With your suggestion you mean by hand, dont you?
    I guess it is not possible to put the first selected pin via script to the top of the stack, because the script will never know which one is the first selected one?

  • Dan Ebberts

    March 9, 2021 at 8:00 am

    Yes, I think your assessment is correct.

Viewing 1 - 5 of 5 posts

Log in to reply.

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