Forum Replies Created

Page 110 of 1081
  • Dan Ebberts

    August 24, 2021 at 3:02 pm in reply to: [help]How make a Gradient Ramp effect follow Text

    I’m not sure this is what you’re after but maybe like this for upper left:

    r = sourceRectAtTime(time,false);

    [r.left, r.top]

    and like this for lower right:

    r = sourceRectAtTime(time,false);

    [r.left + r.width, r.top + r.height]

  • Dan Ebberts

    August 24, 2021 at 12:49 pm in reply to: Adding points to a shape layer with expressions

    I’m not sure if this is what you mean:

    S = effect("Speed")("Slider");

    A = effect("Amp")("Slider");

    F = effect("Frequency")("Slider");

    R = effect("Resolution")("Slider");

    W = effect("Width")("Slider");

    P = [[0,1080]];

    for (i=0; i<R; i++) {

    P.push([W/R*i, Math.sin(time*S+i /(R/F))*A]);}

    P.push([W,1080]);

    createPath(P, [], [], true)

  • Dan Ebberts

    August 23, 2021 at 8:08 pm in reply to: Adding points to a shape layer with expressions

    Maybe you start with the first point already in the array and add the last one after the loop?

    S = effect("Speed")("Slider");

    A = effect("Amp")("Slider");

    F = effect("Frequency")("Slider");

    R = effect("Resolution")("Slider");

    W = effect("Width")("Slider");

    P = [[0,A]];

    for (i=0; i<R; i++) {

    P.push([W/R*i, Math.sin(time*S+i /(R/F))*A]);}

    P.push([W/R*i,A]);

    createPath(P, [], [], true)

  • You just need to add a couple of carriage returns:

    R1 = comp("24K_Promo_Control").layer("First line").text.sourceText;

    R2 = comp("24K_Promo_Control").layer("second line").text.sourceText;

    R3 = comp("24K_Promo_Control").layer("third line").text.sourceText;

    R1 + "\r" + R2 + "\r" + R3

  • Dan Ebberts

    August 20, 2021 at 10:28 pm in reply to: toComp… I just don’t get it

    >So if it’s a.toComp([0,0,0]) I get that [0,0,0] is the top-left corner of the comp

    No, a.toComp([0,0,0]) would translate layer a’s upper left corner (usually) into comp coordinates. It’s useful if you want to position another layer (let’s say layer b) over a specific point on layer a for which you have the coordinates in layer a’s coordinate system. So the Position expression to put layer b on layer a’s upper left corner would be:

    a = thisComp.layer("a");

    a.toComp([0,0,0])

    To put layer b over layer a’s anchor point:

    a = thisComp.layer("a");

    a.toComp(a.anchorPoint)

    To put layer b over the Bulge Center of layer a’s Bulge effect:

    a = thisComp.layer("a");

    a.toComp(a.effect("Bulge")("Bulge Center"))

    The thing that these three examples have in common is that the parameter provided to toComp() is always a point relative to layer a’s upper left corner and the result is always in the comp’s coordinate system. Note that you need the a. prefix of a.toComp to tell the expression engine that you’re providing a point in layer a’s coordinate system. If you leave that out, it will assume you’re referring the layer space of the layer with the expression (layer b in these examples), which would probably not be useful. Hope that helps.

  • Try using this for the Rectangle 1 Position transform:

    fromComp([50,50])

  • Dan Ebberts

    August 20, 2021 at 4:31 pm in reply to: Rename Expression Controllers

    Did you try using app.project.autoFixExpressions(oldText, newText) after changing names with your script?

  • Tomas, I’m not sure what you’re asking exactly, but it looks like tracking adds that many pixels to the space between each pair of characters. So if tracking is 10 and the text is 9 characters, it will increase the width of the text by 80. However, if you’re trying to set the tracking by using that layer’s own sourceRectAtTime().width as part of the calculation, I think that may create some kind of deadlock conflict that will keep it from solving correctly. Not completely sure about that though.

  • Dan Ebberts

    August 17, 2021 at 7:22 pm in reply to: Fit to Comp Width

    I guess that would be like this:

    var myComp = app.project.activeItem;

    var myLayer = myComp.layer(1);

    var s = myLayer.property("Scale").value;

    var x = (myComp.width*myComp.pixelAspect)/(myLayer.width*myLayer.source.pixelAspect);

    var y = myComp.height/myLayer.height;

    myLayer.property("Scale").setValue([s[0]*x,s[1]*y]);

    Or an expression like this:

    x = (thisComp.width*thisComp.pixelAspect)/(width*thisLayer.source.pixelAspect);

    y = thisComp.height/height;

    [value[0]*x,value[1]*y]

  • Dan Ebberts

    August 16, 2021 at 12:55 am in reply to: A way to divide numbers between positive and negative

    Like this maybe:

    max = effect("Slider Control")("Slider");

    linear(value,0,max,-max/2,max/2)

Page 110 of 1081

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