Forum Replies Created

Page 45 of 65
  • Andrei Popa

    October 1, 2019 at 2:33 pm in reply to: Auto-scale text depending upon text length

    Add this to scale:

    var padding = 500;

    value * (width-padding*2)/sourceRectAtTime(time,false).width;

    To make sure the text stays in the middle, you could add this to the anchorPoint and then press ctrl+home to place it in the middle of the comp.

    var myWidth = sourceRectAtTime(time,false).width;
    var left = sourceRectAtTime(time,false).left;
    var myHeight = sourceRectAtTime(time,false).height;
    var top = sourceRectAtTime(time,false).top;
    [left+myWidth/2,myHeight/2+top]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 1, 2019 at 6:21 am in reply to: Slider Position snapping with Checkbox control

    How do you choose the 4 positions? By proximity? You wish to activate/deactivate this behaviour with your checkbox?

    Andrei
    My Envato portfolio.

  • Andrei Popa

    September 30, 2019 at 7:58 am in reply to: How can I get parameter from other ScriptUI?

    I think that if you define a global variable in one of your scripts, something like “var myText=UI.textbox.text”(i don’t know if it will be the same for your UI), you can use it in the other. Just be careful with the naming, so you don’t use it somewhere else.

    I know that After Effects stores globally the variables if they are not within functions.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    September 25, 2019 at 3:30 pm in reply to: If / else – source text – Expression

    You could write it more beautiful like this:
    ((thisComp.layer("Text").text.sourceText =="") ? 0 : 100

    Andrei
    My Envato portfolio.

  • Andrei Popa

    September 25, 2019 at 6:24 am in reply to: Event listeners for dockable panels

    I think you need to add the event listener to your text field, not to the app. But I don’t know of a way to make it listen the save of the project.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    September 23, 2019 at 8:41 am in reply to: Time remap keyframes loop, then continue

    It is possible but it is exponentially more difficult.
    You need to create some arrays of intervals and see in which interval the time fits.
    Then you need to see which time from the precomp you need to use in the given interval.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    September 23, 2019 at 8:32 am in reply to: Using sliders to change time of opacity shifts

    This has been a bit more difficult than i first imagined.

    You need to create a control layer with 3 sliders: Duration, Forground layers, Layers numbers.

    The expression takes one value from duration keyframes as the duration of the animation for each cycle. Ex: Duration has 3 keyframes:1,2,3. The first 3 cycles will have the duration of the animation 1,2 respectively 3. It does not matter where the keyframes are in time. After 3 cycles, the animation continues with the last duration for all the folowing cycles.

    If no keyframe is present in Duration slider, it will take its value and create cycles with that.

    You need to add this exression to the opacity of your layers:

    layersNumber = thisComp.layer("Control Layer").effect("Layers Number")("Slider");
    forGroundLayers = thisComp.layer("Control Layer").effect("Foreground Layers")("Slider");
    dur = thisComp.layer("Control Layer").effect("Duration")("Slider");//Duration for the animation

    function extractCycles(myDur){
    cycleValues = [inPoint];
    for (var i=1; i<=myDur.numKeys; i++){
    cycleValues.push(cycleValues[i-1] + myDur.key(i).value * layersNumber);
    }
    if (myDur.numKeys == 0) var cycleValues = myDur.value;
    return cycleValues;
    }

    cycleStarts = extractCycles(dur);
    lastCycleEnd = cycleStarts[cycleStarts.length-1];
    myIndex = index-1-forGroundLayers;

    if (dur.numKeys>0){
    if (time < lastCycleEnd){
    //Check to see in which cycle we fit
    var i = cycleStarts.length-1;
    while(cycleStarts[i] > time && i!=0){
    i--;
    }
    cycleLength = cycleStarts[i+1]-cycleStarts[i];
    thisDuration = cycleLength/layersNumber;
    (((time-cycleStarts[i]-myIndex*thisDuration) % cycleLength) <= thisDuration) ? 100 : 0;

    }else{
    //Continuously loops with the last duration
    (((time-lastCycleEnd-myIndex*dur.key(dur.numKeys).value) % (dur.key(dur.numKeys).value*layersNumber)) <= dur.key(dur.numKeys).value) ? 100 : 0;
    }
    }else{
    ((time-inPoint-myIndex*dur) % (dur*layersNumber) <= dur) ? 100 : 0;
    }

    And here is the aep project

    Andrei
    My Envato portfolio.

  • Andrei Popa

    September 23, 2019 at 8:26 am in reply to: Using sliders to change time of opacity shifts

    This has been way harder than i first imagined ????

    You need 3 sliders on your control layer: Forground layers, Duration and Number of layers.
    Add this expression to opacity to each of the layers:
    layersNumber = thisComp.layer("Control Layer").effect("Layers Number")("Slider");
    forGroundLayers = thisComp.layer("Control Layer").effect("Foreground Layers")("Slider");
    dur = thisComp.layer("Control Layer").effect("Duration")("Slider");//Duration for the animation

    function extractCycles(myDur){
    cycleValues = [inPoint];
    for (var i=1; i<=myDur.numKeys; i++){
    cycleValues.push(cycleValues[i-1] + myDur.key(i).value * layersNumber);
    }
    if (myDur.numKeys == 0) var cycleValues = myDur.value;
    return cycleValues;
    }

    cycleStarts = extractCycles(dur);
    lastCycleEnd = cycleStarts[cycleStarts.length-1];
    myIndex = index-1-forGroundLayers;

    if (dur.numKeys>0){
    if (time < lastCycleEnd){
    //Check to see in which cycle we fit
    var i = cycleStarts.length-1;
    while(cycleStarts[i] > time && i!=0){
    i--;
    }
    cycleLength = cycleStarts[i+1]-cycleStarts[i];
    thisDuration = cycleLength/layersNumber;
    (((time-cycleStarts[i]-myIndex*thisDuration) % cycleLength) <= thisDuration) ? 100 : 0;

    }else{
    //Continuously loops with the last duration
    (((time-lastCycleEnd-myIndex*dur.key(dur.numKeys).value) % (dur.key(dur.numKeys).value*layersNumber)) <= dur.key(dur.numKeys).value) ? 100 : 0;
    }
    }else{
    ((time-inPoint-myIndex*dur) % (dur*layersNumber) <= dur) ? 100 : 0;
    }

    Andrei
    My Envato portfolio.

  • Andrei Popa

    September 21, 2019 at 8:55 pm in reply to: Using sliders to change time of opacity shifts

    Hey. I’m not at the office until monday morning CET and I don’t have After Effects at home.
    I’ll try to make something work then and reply, in case anyone else does not do it before me 😀

    Andrei
    My Envato portfolio.

  • Andrei Popa

    September 21, 2019 at 7:56 am in reply to: Array piece can’t expand to more than 1 value

    createPath(points = [a,b,c], isClosed = true)

    Andrei
    My Envato portfolio.

Page 45 of 65

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