Forum Replies Created

Page 1 of 2
  • Ronan De lacy

    January 29, 2022 at 2:10 pm in reply to: Change font style per character of text

    Hey Filip,

    I think that I have found a solution to this, using regex expression on the source text property. For my use case, I am working with localising comps, where the target language and Latin characters will have different typefaces.

    text.sourceText.style.setFont("PingFangTC-Medium");

    var textIndex = text.sourceText.length;

    var RE = /[a-z_ ]/gi;

    txt = text.sourceText.replace(RE, function($0) {

    return '~'.repeat($0.length);

    });

    if(txt.charAt(textIndex - 1) == '~') { style.setFont("ComicSansMS-Bold"); }

    The “solution” is a bit buggy and works intermittently. Would be very interested to hear your take on it. I’ve attached a basic example project file if anyone want’s to take a look.

  • Ronan De lacy

    May 20, 2021 at 2:16 pm in reply to: Penner easing expressions with layer slide

    Hi Dan,

    Thanks for your explanations here. It’s starting to make things a little clear when trying ut use Penner easing in expressions. One question, however.

    I have it working with easeInOutExpo, but when I switch out the function to another Penner ease, either the scale of the object increases 100x(ish) or the animation loops.

    Any idea where I’m going wrong?


    Here’s my expression as it stands, working with easeInOutExpo.

    function easeInOutExpo (t, b, c, d) {

    t /= d/2;

    if (t < 1) return c/2 * Math.pow( 2, 10 * (t - 1) ) + b;

    t--;

    return c/2 * ( -Math.pow( 2, -10 * t) + 2 ) + b;

    };

    Out=thisComp.layer("Controls").effect("Resolve By")("Slider"); //When should the animatiob be complete

    Dur=thisComp.layer("Controls").effect("End Resolve Duration")("Slider"); //How long should the animtion be

    x1 = 0;

    x2 = 24;

    t = time- Out+Dur;

    d = Dur;

    x=transform.scale[0]+easeInOutExpo(t,x1, x2 - x1, d);

    y=transform.scale[1]+easeInOutExpo(t,x1, x2 - x1, d);

    [x,y]

    And this one, for example, just loops continuously

    function easeInOutSine (t, b, c, d) {

    return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;

    }

    Out=thisComp.layer("Controls").effect("Resolve By")("Slider");//When should the animatiob be complete

    Dur=thisComp.layer("Controls").effect("End Resolve Duration")("Slider");//How long should the animtion be

    x1 = 0;

    x2 = 24;

    t = time- Out+Dur;

    d = Dur;

    x=transform.scale[0]+easeInOutSine(t,x1, x2 - x1, d);

    y=transform.scale[1]+easeInOutSine(t,x1, x2 - x1, d);

    [x,y]

  • Thank you, Filip! This is just what I wanted to achieve!

  • Hi Fabrice – thanks so much, this has corrected my path!!

  • Hi Andrei,

    I have a follow up question to my last (sorry).

    <font face=”inherit”>If I wanted to filter the results that appear in my dropdown list by label color, how should I go about it? for example, if </font>I<font face=”inherit”> only want the list to contain layers that have the have a label color of red (1)?</font>

    <font face=”inherit”>
    </font>

    <font face=”inherit”>
    </font>

  • Hi Filip,

    Thank you so much – all if your suggestions worked.

    And yes, compWidth and compHeight are globals within the larger script.

    Cheers,

    Ronan

  • Ronan De lacy

    January 21, 2021 at 1:10 pm in reply to: Adding Shapes with ExtendScript

    Crisis averted. I moved the add stroke to the bottom of the stack and placed it within it’s own variable. See below for fix

    var addLayer = app.project.item(5).layers;

    //Add Headline Grid

    var addGrid = addLayer.addShape();

    addGrid.label = (13);

    addGrid.name = ("headline-text-grid");

    var group = addGrid.content.addProperty("ADBE Vector Group");

    group.name = "P1";

    var myShapeGroup = group.content.addProperty("ADBE Vector Shape - Group");

    var myShape = new Shape();

    myShape.vertices = [[-compWidth/2,-compHeight/2],[compWidth/2,-compHeight/2]];

    myShape.closed = false;

    // set the value of th path too the shape object

    myShapeGroup.property("ADBE Vector Shape").setValue(myShape);

    var stroke = group.content.addProperty("ADBE Vector Graphic - Stroke"); // add a stroke

  • Hi Andrei. That worked, thanks so much!!

  • Ronan De lacy

    November 19, 2020 at 2:16 pm in reply to: Variables returning as Undefined – ExtendScript

    Thanks Matt,

    The weird thing here is that the way I have it structured on the above post, it works sometimes and doesn’t others. I’m using Visual Studio Code and I’m a bit of a noob with it comes to ExtendScript. I cannot figure out what’s going on with it!

  • Ronan De lacy

    July 9, 2020 at 10:09 am in reply to: else if statements +3 values

    Hey Filip – Thanks so much… I’ve been tearing my hair all morning trying to figure out where I went wrong!!

Page 1 of 2

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