Forum Replies Created

Page 31 of 65
  • Try to directly calculate the distance for each tick. Accessing it with index-1 is reaaaly slow because I think AE re-calculates each position to the current one. So, let’s say layer 30, has to calculate 29 other positions so it can add the distance in the end. Try directly multiplying the distance with the number of the current tick. firstiIndex must be the index of your first tick:

    firstIndex = 2;
    d = thisComp.layer("Control").effect("Distance")("Slider");
    value + (index-firstIndex)*d

    Andrei
    My Envato portfolio.

  • var newLayer = app.project.activeItem.layer('##background').duplicate()

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 28, 2020 at 11:38 am in reply to: Clamp behaviour confusing

    There is the normal value, the one before applying the expression. That is 1k. The expression is run and applies a value over that one, the final that is showed. But the normal value is still 1k. The expression can’t change that.

    If you disable the expression, the ball goes to 1k. Expressions can’t change this normal value, they just apply stuff over it. Like a glove. So if your value is 1k, the expression shows 618. When you move it up, the expression checks again to see what the normal value is. So until that value goes under 618, the expression is run over that value, but without changing it. I don’t really know how to make this clearer.

    Expressions are like a colored glass. You see the things colored, but the glass does not change the color of the things, only the way you see it.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 28, 2020 at 6:57 am in reply to: Text expression random wiggLe per character

    I am just curious. What happend to your lowercase L? 😀

    Andrei
    My Envato portfolio.

  • Didn’t see Dan answered.
    His solution makes them appear in random order. Mine keeps the order of the layers.

    Andrei
    My Envato portfolio.

  • Add a slider to your first layer. This will save the times in which the layers appear. Add the following expression. You can modify at which key to start by changing the parameter in the key(2) : sTime = thisLayer.opacity.key(2).time;. numLayers is the number of child layers you have(exclude your main). maxDur is the maximum duration of the delay in seconds.


    function getRandomTimes(sTime, numLayers, maxDur){
    var crtTime = sTime;
    var values = [sTime];
    for(var i=1; i <=numLayers;i++){
    seedRandom(1,true);
    crtTime+=random(maxDur);
    values.push(crtTime);
    }
    return values;
    }

    sTime = thisLayer.opacity.key(2).time;
    numLayers = 7;
    maxDur = 1;
    var times = getRandomTimes(sTime, numLayers, maxDur);
    val = 0;
    i=0;
    while (time>=times[i]){
    val=i+1;
    i++;
    }
    val

    Then, to the following layers add this to opacity. firstLayerIndex is the index of your main layer in the current composition.

    firstLayerIndex = 2;
    index-firstLayerIndex <= thisComp.layer("Shape Layer 1").effect("Slider Control")("Slider") ? 100 : 0;

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 27, 2020 at 7:06 am in reply to: Scripting: access all expressions in Comp /

    I do not know of any way to select all expressions in a composition.
    I think you need to use your current method and just loop through all the properties.

    But to check if property has expressions, use this: if(property.expression != undefined)

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 27, 2020 at 7:00 am in reply to: Add marker everytime a value is detected

    First of all, never do a while loop with a condition that is always true. You should put your break condition there.

    And your above variable does not let the script check again for threshold equality. You must have a situation when that gets back to false.

    Haven’t tested, but give this a try:


    var comp = app.project.activeItem;
    var videoLayer = comp.selectedLayers[0];
    var time = comp.time;
    var frame = Math.round(time / comp.frameDuration);
    var opacityLevel = videoLayer.property("Transform").property("Opacity");
    var threshold = 48.0;

    above = false;
    while (frame <= 100) {
    t = frame * comp.frameDuration;
    if (above) {
    if (opacityLevel.valueAtTime(t, true) != threshold) {
    frame++;
    above = false;
    }
    } else if (opacityLevel.valueAtTime(t, true) == threshold) {
    above = true;
    var myMarker = new MarkerValue("Cut");
    videoLayer.property("Marker").setValueAtTime(t, myMarker);
    }
    frame++;
    }

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 15, 2020 at 6:49 am in reply to: Baking Expression Selector?

    If you don’t need to change them afterwards, you could run a script and make them keyframes directly.
    But if you change the text afterwards, you may get some unpleasant results.

    If you want the text to also be responsive, you have no alternative. Maybe just optimize your expression. Complicated regex can be computational heavy.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 14, 2020 at 2:22 pm in reply to: Link position to scale expression ?

    https://www.youtube.com/watch?v=no9gtkH3sGY

    Andrei
    My Envato portfolio.

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

Page 31 of 65

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