Forum Replies Created

Page 1029 of 1081
  • Dan Ebberts

    April 9, 2006 at 6:31 am in reply to: Dan Ebberts Audio Sync

    Brief run down, huh? OK –

    The key is this part of the code:

    n = 0;
    if (trigger.marker.numKeys > 0){
    n = trigger.marker.nearestKey(time).index;
    if (trigger.marker.key(n).time > time){
    n–;
    }
    }

    Which sets variable “n” to number of the previous marker in the trigger layer, or 0 if a marker hasn’t been reached yet. The rest of the code just figures out what to set the remapped time to based on the previous marker in the trigger layer, the current time, and the marker (if any) of the time remapped layer.

    Dan

  • Dan Ebberts

    April 9, 2006 at 6:25 am in reply to: make a layer move away from point (expression)

    If you wanted to create more of an explosion, you could use something like this and duplicate your layer a bunch of times:

    seedRandom(index,true);
    angle = random(360); // angle of travel away from null
    spd = random(150,400); // speed (pixels per second)

    rads = degreesToRadians(angle);
    xComponent = Math.cos(rads);
    yComponent = Math.sin(rads);
    thisComp.layer(“Null 1”).position + [xComponent,yComponent]*spd*time;

    Dan

  • Dan Ebberts

    April 9, 2006 at 6:25 am in reply to: make a layer move away from point (expression)

    If you wanted to create more of an explosion, you could use something like this and duplicate your layer a bunch of times:

    seedRandom(index,true);
    angle = random(360); // angle of travel away from null
    spd = random(150,400); // speed (pixels per second)

    rads = degreesToRadians(angle);
    xComponent = Math.cos(rads);
    yComponent = Math.sin(rads);
    thisComp.layer(“Null 1”).position + [xComponent,yComponent]*spd*time;

    Dan

  • Dan Ebberts

    April 9, 2006 at 6:21 am in reply to: make a layer move away from point (expression)

    You might start with something like this:

    angle = 45; // angle of travel away from null
    spd = 200; // speed (pixels per second)

    rads = degreesToRadians(angle);
    xComponent = Math.cos(rads);
    yComponent = Math.sin(rads);
    thisComp.layer(“Null 1”).position + [xComponent,yComponent]*spd*time;

    Dan

  • Dan Ebberts

    April 9, 2006 at 6:21 am in reply to: make a layer move away from point (expression)

    You might start with something like this:

    angle = 45; // angle of travel away from null
    spd = 200; // speed (pixels per second)

    rads = degreesToRadians(angle);
    xComponent = Math.cos(rads);
    yComponent = Math.sin(rads);
    thisComp.layer(“Null 1”).position + [xComponent,yComponent]*spd*time;

    Dan

  • Dan Ebberts

    April 8, 2006 at 10:50 pm in reply to: Dan Ebberts Audio Sync

    This version is a little better. If the time remapped animation you want to trigger starts at time = 0, you don’t need a marker on the time remapped layer:

    trigger = thisComp.layer(“myTriggerLayer”); // layer with trigger markers
    n = 0;
    if (trigger.marker.numKeys > 0){
    n = trigger.marker.nearestKey(time).index;
    if (trigger.marker.key(n).time > time){
    n–;
    }
    }
    if (marker.numKeys > 0) hit = marker.key(1).time else hit = 0;
    if (n == 0) t = 0 else t = trigger.marker.key(n).time;
    time – t + hit;

    Dan

  • Dan Ebberts

    April 8, 2006 at 10:50 pm in reply to: Dan Ebberts Audio Sync

    This version is a little better. If the time remapped animation you want to trigger starts at time = 0, you don’t need a marker on the time remapped layer:

    trigger = thisComp.layer(“myTriggerLayer”); // layer with trigger markers
    n = 0;
    if (trigger.marker.numKeys > 0){
    n = trigger.marker.nearestKey(time).index;
    if (trigger.marker.key(n).time > time){
    n–;
    }
    }
    if (marker.numKeys > 0) hit = marker.key(1).time else hit = 0;
    if (n == 0) t = 0 else t = trigger.marker.key(n).time;
    time – t + hit;

    Dan

  • Dan Ebberts

    April 8, 2006 at 10:46 pm in reply to: Dan Ebberts Audio Sync

    Try this expression instead. You’ll need to change the name of the layer in the first line to match your triggering layer.

    trigger = thisComp.layer(“myTriggerLayer”); // layer with trigger markers
    n = 0;
    if (trigger.marker.numKeys > 0){
    n = trigger.marker.nearestKey(time).index;
    if (trigger.marker.key(n).time > time){
    n–;
    }
    }
    hit = marker.key(1).time;
    if (n == 0) t = 0 else t = trigger.marker.key(n).time;
    time – t + hit;

    Dan

  • Dan Ebberts

    April 8, 2006 at 10:46 pm in reply to: Dan Ebberts Audio Sync

    Try this expression instead. You’ll need to change the name of the layer in the first line to match your triggering layer.

    trigger = thisComp.layer(“myTriggerLayer”); // layer with trigger markers
    n = 0;
    if (trigger.marker.numKeys > 0){
    n = trigger.marker.nearestKey(time).index;
    if (trigger.marker.key(n).time > time){
    n–;
    }
    }
    hit = marker.key(1).time;
    if (n == 0) t = 0 else t = trigger.marker.key(n).time;
    time – t + hit;

    Dan

  • Dan Ebberts

    April 8, 2006 at 10:26 pm in reply to: follow the leader 2 (expression ques.)

    Which expression are you trying to use?

    You probaly just need to use a layer space transform to get the world postion of your parented layer with the appropriate time delay.

    Dan

Page 1029 of 1081

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