Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions .duration not working

  • .duration not working

    Posted by Paul Roper on May 15, 2013 at 10:32 am

    Hello,

    I’m trying to obtain the duration of a layer, but AE refuses to co-operate. It just gives me the error “Class: ‘Layer’ has no property or method named ‘duration’. It bloody does have “duration”!

    I’ve created a text layer and put into the source text the expression:

    thing=thisComp.layer(“95253_00_02_MM30_Killed_Key_test.mov 2”);
    thing.duration

    I’ve also tried:

    thisComp.layer(“95253_00_02_MM30_Killed_Key_test.mov 2”).duration

    What is After Effects’ major malfunction?!

    If I modify the expression to:

    thing=thisComp.layer(“95253_00_02_MM30_Killed_Key_test.mov 2”);
    thing.source.duration

    …then it works…but gives me the duration of the source footage, ignoring the in/out points I’ve set on that layer. I’ve made a temporary workaround, subtracting the inpoint from the outpoint:

    thisComp.layer(“95253_00_02_MM30_Killed_Key_test.mov 2”).outPoint-thisComp.layer(“95253_00_02_MM30_Killed_Key_test.mov 2”).inPoint

    But why won’t “duration” just work?!

    – Paul

    Todd Kopriva replied 13 years ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    May 15, 2013 at 4:33 pm

    >But why won’t “duration” just work?!

    As you’ve discovered, duration wasn’t implemented as a layer attribute in the expression language. I always use some combination of inPoint, outPoint, and startTime.

    Dan

  • Paul Roper

    May 15, 2013 at 5:08 pm

    Thanks for the reply.

    But that’s just plain silly that we’re on version 11 (12 if you count the Controversial Cloud version) and there’s an attribute that just doesn’t work.

  • Todd Kopriva

    May 15, 2013 at 11:15 pm

    You can submit a bug report to make sure that something like this gets in the queue to be fixed:
    https://www.adobe.com/go/wish

    ———————————————————————————————————
    Todd Kopriva, Adobe Systems Incorporated
    After Effects quality engineering
    After Effects team blog
    ———————————————————————————————————

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