Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Opacity change at markers

  • Opacity change at markers

    Posted by Alex Dinnin on January 22, 2008 at 1:36 pm

    Hi All,

    I am trying to set up a composition that people in my office are going to use again and again..

    what I need to do basically is.. have a layers opacity change every time it passes a marker…

    so at marker 1 it is 100% marker 2 0% marker 3 100%

    The problem I have is they need to be Hold Markers.. so there is no transition..

    So I can move the markers and the opacity follows them..

    ***edit*** actually whilst trying to work this out myself.. referencing comp markers rather than layer markers would be easier !!!

    I hope this makes sense..

    any help would be greatly appreciated

    regards
    Alex

    Filip Vandueren replied 18 years, 6 months ago 2 Members · 3 Replies
  • 3 Replies
  • Filip Vandueren

    January 22, 2008 at 2:25 pm

    Well, you can only have 10 comp-markers…

    here’s the expresso for layermarkers (apply to opacity):


    if (marker.numKeys) {
    // what's the nearest marker ?
    nearest_marker=marker.nearestKey(time)

    // if the nearestKey lies in the future,
    // subtract 1 to get the index of the 'current' key

    current_marker_index = 1 + nearest_marker.index - (nearest_marker.time > time);

    // convert our running marker index to
    (current_marker_index%2)*100

    } else {
    // degrade nicely if there are no markers:
    value;
    }

  • Alex Dinnin

    January 22, 2008 at 3:27 pm

    Thanks for replying

    I have applied this to the opacity.. and it doesn’t seem to do anything ??

    is this for cs3 or can it be applied over all versions ?

    Alex

  • Filip Vandueren

    January 22, 2008 at 5:17 pm

    I only have CS3 installed right now.

    There were some bugs in the marker expressions for the previous versions of AE, but I believe they only had to do with not being able to access the name/text of a marker.

    Let’s debug:
    First of all: the expression looks to markers on it’s own layer.

    Try this on a layer without markers:

    if (thisLayer.marker.numKeys>0) {
    50;
    } else {
    0;
    }

    Is your layer at 100, 50 or 0 % ? -> it should be 0%

    Add a marker, -> it should be 50%

    If that worked, then try changing the first line of the previous expressions to:

    if (thisLayer.marker.numKeys>0)

    that might help.

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