Forum Replies Created

Page 1 of 2
  • Pete Menich

    September 13, 2023 at 1:25 pm in reply to: Per character 3D question

    nice. that looks much better!

  • Pete Menich

    September 13, 2023 at 9:19 am in reply to: Per character 3D question

    Het Filip,

    I suspected as much. 😞

    But thank you for confirming.

    Pete

  • This seems to do the pause thing…

    spd = effect("speed")("Slider"); // pixels per second

    pause = effect("pause")("Slider"); // pause divider

    startIndex = 3;

    endIndex = 7;

    curIndex = startIndex;

    accumTime = prevAccum = 0;

    while (accumTime <= time){

    curLayer = thisComp.layer(curIndex);

    preLayer = thisComp.layer(curIndex+1);

    curRect = curLayer.sourceRectAtTime(time,false);

    curPos = curLayer.toComp([curRect.left+curRect.width/2, curRect.top+curRect.height/2]);

    nextLayer = thisComp.layer(curIndex+1);

    nextRect = nextLayer.sourceRectAtTime(time,false);

    nextPos = nextLayer.toComp([nextRect.left+nextRect.width/2, nextRect.top+nextRect.height/2]);

    v = nextPos - curPos;

    dist = length(v);

    moveDur = dist/spd;

    pauseDur = 1 + (preLayer.content("Group 1").content("Rectangle Path 1").size[1] / pause);

    totalDur = moveDur + pauseDur;

    prevAccum = accumTime;

    accumTime += totalDur;

    curIndex++;

    if (curIndex >= endIndex) break;

    }

    delta = time - prevAccum;

    delta > moveDur ? nextPos : curPos + normalize(v)*ease(delta,0,moveDur,0,dist);

  • Hey Dan, Amazing!

    The only thing I forgot to mention is that I need it in 3D 😬 – as I’m parenting a camera to the null.

    I seems to work though if the Null stays 2D.

    The dynamic pause is required because the boxes contain text, so the bigger the boxes Y dimension, the more text the box contains and the longer you need to read it.

    Obviously, ChatGTP can’t compete with the Ebbert’s brain!

  • this kind of works, but the transition and pause duration are not dynamic

    // Set the duration of each transition and pause period in seconds

    transitionDuration = 2;

    pauseDuration = 2;

    // Define the start and end layer indices

    startLayerIndex = 3; // Change this to match the index of the starting layer

    endLayerIndex = 7; // Change this to match the index of the ending layer

    // Calculate the total number of transitions

    totalTransitions = endLayerIndex - startLayerIndex;

    // Calculate the current transition index based on the current time

    currentTransitionIndex = Math.min(Math.floor((time - inPoint) / (transitionDuration + pauseDuration)), totalTransitions - 1);

    // Calculate the start and end layers for the current transition

    startLayer = thisComp.layer(startLayerIndex + currentTransitionIndex);

    endLayer = thisComp.layer(startLayerIndex + currentTransitionIndex + 1);

    startPos = startLayer.transform.position;

    endPos = endLayer.transform.position;

    // Calculate the time elapsed since the start of the current transition

    transitionStartTime = currentTransitionIndex * (transitionDuration + pauseDuration);

    transitionElapsedTime = time - inPoint - transitionStartTime;

    // Use an ease function to animate from the start position to the end position

    ease(transitionElapsedTime, 0, transitionDuration, startPos, endPos);


  • Pete Menich

    November 21, 2022 at 3:21 pm in reply to: Insert Line Break every X number of characters

    Yeah I got it working in the end with…

    m = thisComp.layer("Captions");
    n=0;
    fs = text.sourceText.style.fontSize * 1000/effect("boxWidth")("Slider");
    if (m.marker.numKeys > 0){
    n = m.marker.nearestKey(time).index;
    if (m.marker.key(n).time > time) n--;
    }
    if (n > 0)
    {text.sourceText.createStyle().setFontSize(fs).setText(m.marker.key(n).comment);
    }else{
    text.sourceText.createStyle().setFontSize(fs).setText("");
    }

    I’m just goofing around making a flexible subs generator.

  • Pete Menich

    November 21, 2022 at 10:39 am in reply to: Insert Line Break every X number of characters

    As always, amazing! Works like a charm.

    Is there a way that if after its been split over two lines and it’s still too long, that it could be split over 3, and then 4 lines etc etc

    I’ve also been trying to use this script….

    https://creativecow.net/forums/thread/paragraph-bouding-control/

    but as my text is being driven by marker comments, it doesn’t work.

    P

    Paragraph bouding control

  • Pete Menich

    November 20, 2022 at 2:24 pm in reply to: Insert Line Break every X number of characters

    I’ve been trying something similar by hacking the original expression in this thread to get a subtitle to add a line break if the width of the text object goes above a certain length.

    This seems to be working…

    txt = thisComp.layer("Captions").text.sourceText;
    dist = thisComp.layer("Captions").sourceRectAtTime().width;
    Wguide = thisComp.layer("width guide").effect("Slider Control")("Slider")
    len = txt.length;
    if (dist > Wguide){
    n = len / 2;
    }else{
    n = len;
    }
    outStr = "";
    newLine = ""
    splt = txt.split(" ")
    for (i = 0; i < splt.length; i++){
    if ((newLine + " " + splt[i]).length > n){
    if (outStr != "") outStr += "\r";
    outStr += newLine;
    newLine = splt[i];
    }else{
    if (newLine != "") newLine += " ";
    newLine += splt[i];
    }
    }
    if (newLine != ""){
    if (outStr != "") outStr += "\r";
    outStr += newLine;
    }
    outStr;

    Except sometimes it splits the text over 3 lines when 2 will do – any suggestions?

  • Pete Menich

    July 7, 2022 at 10:10 am in reply to: blend random value every n frames and hold

    Amazing as always Dan!

    (you’d think by now I’d know this stuff!)

    Thank you.

  • Pete Menich

    May 15, 2022 at 11:46 am in reply to: .replace method not working

    weird. Now it works. Amazing!

    Thanks Filip

Page 1 of 2

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