Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions After Effects Script with Light Attributes (Repost from AE forum)

  • After Effects Script with Light Attributes (Repost from AE forum)

    Posted by Andrew Dickinson on March 11, 2010 at 6:19 pm

    Hi, I’m currently writing a script that recursively searches through the attributes of all layers in a comp, and determines if they have keyframes within a certain range.

    Everything’s going smoothly, until I tested it on a comp that a co-worker had made. It had a light layer that was at one point a spot, and keyframed, and then changed to a parallel light.

    As you may notice in After Effects for light layers, some/all transform properties that are accessible to spot lights are hidden for parallel, point, and ambient lights in After Effect’s composition window when you change it. However, in the script, the code is still able to access these properties as attributes (as if they were there!), and when it tries to attempt to select the keyframes, I get the error:

    “After Effects Error: Can not “set selected at key” with this property, because the property or a parent property is hidden.”

    Basically in sudo, the code runs:

    if Property isTimeVarying:
       Deselect All Keyframes of Property
       for all keyframes:
          If it is in range:
             Property setSelectedAtKey to true

    So, for instance, for a parallel light, when I try to select the (hidden) orientation keyframe, I get the error.

    Does anyone know how to check if these properties that are hidden through scripting?

    I’ve tried checking the attributes:

    .enabled
    .active
    .elided
    .canSetEnabled

    (all of which are the same for the properties if it’s hidden or not)

    as well as:

    .hidden
    .visible
    .shy
    .locked

    (all of which are undefined)

    Lloyd Alvarez replied 16 years, 2 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 11, 2010 at 6:27 pm

    Have you tried using a try/catch construct to catch the error locally and then just move on to the next layer?

    Dan

  • Andrew Dickinson

    March 11, 2010 at 6:43 pm

    I did. I think I saw you use that method for another script I found when I was searching the error message on the interwebs.

    I just feel in my heart that I should be able to access that information somewhere in the Property object…

  • Lloyd Alvarez

    March 11, 2010 at 7:40 pm

    Sounds like you found a bug to me. Please report it at https://adobe.com/go/wish

    -Lloyd

    https://aescripts.com

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