Forum Replies Created

  • Tom Theys

    October 24, 2019 at 3:50 pm in reply to: Autoscale layers to both height and width

    Made a better version, but still need to look at the maximum height

    var maxw = 1540;
    var maxh = 800;

    var nr_rules = effect(“nr_regels”)(“Slider”);

    var r1 = comp(“txtFill s1r1”).layer(“txt-w1”);
    var r2 = comp(“txtFill s1r2”).layer(“txt-w1”);
    var r3 = comp(“txtFill s1r3”).layer(“txt-w1”);

    var r1w = r1.sourceRectAtTime().width;
    var r2w = r2.sourceRectAtTime().width;
    var r3w = r3.sourceRectAtTime().width;

    var totalw = Math.max(r1w,r2w,r3w);
    var totalw = nr_rules == 2 ? Math.max(r1w,r2w) : totalw;
    var totalw = nr_rules == 1 ? r1w : totalw;

    var r1h = r1.sourceRectAtTime().height;
    var r2h = r2.sourceRectAtTime().height;
    var r3h = r3.sourceRectAtTime().height;

    var totalh = r1h + r2h + r3h;
    var totalh = nr_rules == 2 ? r1h + r2h : totalh;
    var totalh = nr_rules == 1 ? r1h : totalh;

    var sw = maxw / totalw * 100;
    var sh = maxh / totalh * 100;

    var tot = 100;

    if (sw >= 140) tot = 140 else tot = sw;

    [tot,tot]

  • Tom Theys

    September 5, 2013 at 7:32 pm in reply to: Split letters from source text and randomize

    Thanks Dan, I will try that.

    I kind of fixed it for now with this

    letters = “design”;
    dur = 7; // frames per letter
    idx = Math.floor(timeToFrames(time – framesToTime(15))/dur)%letters.length;
    if (time > framesToTime(15))
    letters[idx]
    else
    letters[0]

    This shows the first letter until the animation starts.

  • Tom Theys

    September 5, 2013 at 1:15 pm in reply to: Split letters from source text and randomize

    Another question, how do I start the script at a specific frame, for example frame 15?
    Sliding the layer in time doesn’t work. I tried adding this, but that doesn’t work neither.

    if (time > .6) {
    letters = “design”;
    dur = 7; // frames per letter
    idx = Math.floor(timeToFrames(time)/dur)%letters.length;
    letters[idx];
    }

    The generated character are linked to an animation that starts at frame 15. So it starts with the letter s and not d, it skips the first two characters.

  • Tom Theys

    August 22, 2013 at 5:33 pm in reply to: Split letters from source text and randomize

    Thanks Dan! Works perfect!

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