Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions custom layer marker triggers

  • custom layer marker triggers

    Posted by Matthew Tully on August 1, 2008 at 4:01 pm

    Howdy all,

    I know there is a way to trigger expressions using a layer marker, but I would like to have several expressions that all rely on makers. Can I define the name of the layer marker to activate the proper triggers?

    I tried this below, added a marker, and commented it as ‘gravity.’

    if (marker.numKeys > 0 && time > marker.key(gravity).time){ 
    expression
    }else{ 
    value 
    } 

    Returns this error:

    Bad method arguments: This layer has no marker named gravity.
    Dan Ebberts replied 17 years, 9 months ago 4 Members · 5 Replies
  • 5 Replies
  • Lloyd Alvarez

    August 1, 2008 at 4:08 pm

    Hey Matthew,

    When you call anything by name you need to put it in quotations:

    if (marker.numKeys > 0 && time > marker.key(“gravity”).time){

    expression

    }else{

    value

    }

    Without quotations it assumes that it’s a variable named gravity and since you had not defined that variable it returned an error, so for example this would also work:

    gravity = “gravity”;

    if (marker.numKeys > 0 && time > marker.key(gravity).time){

    expression

    }else{

    value

    -Lloyd

    }

    https://aescripts.com

  • Matthew Tully

    August 1, 2008 at 4:15 pm

    Thanks Lloyd. I totally over looked that, I was using instead of . Duh!

    I’ve been working on an animation framework that loads from an external file (inspired by Maltaannon) and I’m looking to have an easy way for users to trigger the functions they are calling.

    The project base should be up on gitHub soon.

  • Mike Clasby

    August 1, 2008 at 4:15 pm
  • Matthew Tully

    August 1, 2008 at 4:32 pm

    Thanks for the tip Mike.

    I’m developing the framework in AE7 tho, so unfortunately I wont be able to look to a “Control” layers’ markers. AE7 I think only allows me to look at the markers on the layer the expression is in?

    There are a number of ways to approach this, but the best solutions require that an expression be able to retrieve the comment field of a layer marker. Fortunately that capability now exists in AE CS3. We’ll also need to use the capability of accessing a marker by its comment field.

    Maybe I should fork the project now and support both versions?

  • Dan Ebberts

    August 1, 2008 at 6:05 pm

    AE7 lets you access markers on any other layer, using the comment as the key index, you just can’t retreive a comment from a marker in AE7.

    Dan

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