Forum Replies Created

Page 132 of 1081
  • This should work:

    txt = comp("CHANGE TEXT").layer("1 Line Small Text").text.sourceText.value;

    cb = comp("CHANGE TEXT").layer("Layout_Selector").effect("Comedy Central")("Checkbox").value;

    myFont = cb ? "AmericanTypewriter" : "Helvetica"

    style.setFont(myFont).setText(txt)

  • Dan Ebberts

    October 3, 2020 at 6:08 pm in reply to: Remove hidden properties and effects

    How does the script know what to delete?

  • Dan Ebberts

    October 2, 2020 at 10:38 pm in reply to: replaceSource and Effects

    I just tried your code and it works for me (the replacement image is still modified by the effect). I’m not sure what could be happening. Maybe a cache or video driver issue–not sure…

  • Dan Ebberts

    October 2, 2020 at 3:12 pm in reply to: Use script to retrieve value from expression

    Here’s a simple example that gets the comp width from a slider control that has an expression:

    var myComp = app.project.activeItem;

    var myWidth = myComp.layer(1).property("Effects").property("Slider Control").property("Slider").valueAtTime(0,false);

    myComp.width = myWidth;

  • Dan Ebberts

    October 1, 2020 at 9:54 pm in reply to: Parenting Advanced lightning origin to a null

    I’m not sure how you’ve been trying to do it, but an Origin expression like this should work:

    L = thisComp.layer("Null 1");

    fromComp(L.toComp(L.anchorPoint))

  • Not exactly, but you could do something like this to test for a text layer:

    try{

    thisComp.layer(index-1).text.sourceText;

    isText = true;

    }catch (e){

    isText = false;

    }

    and something like this to test for a comp layer:

    try{

    isComp = thisComp.layer(index-1).source instanceof Comp;

    }catch (e){

    isComp = false;

    }

  • Dan Ebberts

    September 30, 2020 at 5:51 pm in reply to: Source text as thisComp.name but also have it lowercase

    Sure. If you use a separator character that’s unlikely to occur otherwise in the text (say, the pipe (|) character, then you could use expressions like this:

    thisComp.name.split("|")[0]; // name

    thisComp.name.split("|")[1]; // job title

    thisComp.name.split("|")[2]; // company

  • Dan Ebberts

    September 28, 2020 at 2:14 pm in reply to: Every X seconds, move in a random direcition.

    Something like this maybe:

    moveDur = .5;

    holdDur = 2;

    segDur = moveDur+holdDur;

    minVal = [0.1*thisComp.width, 0.1*thisComp.height];

    maxVal = [0.9*thisComp.width, 0.9*thisComp.height];

    seed = Math.floor(time/segDur);

    segStart = seed*segDur;

    seedRandom(seed,true);

    startVal = random(minVal,maxVal);

    seedRandom(seed+1,true);

    endVal = random(minVal,maxVal);

    ease(time,segStart,segStart + moveDur, startVal, endVal);

  • See if this path expression works for you:

    p = thisProperty;

    r = sourceRectAtTime(0,false);

    pts = p.points();

    newPoints = [];

    for (i = 0; i < pts.length; i++){

    newPoints.push( [pts[i][0]*thisComp.width/r.width,pts[i][1]*thisComp.height/r.height]);

    }

    createPath(newPoints,p.inTangents(),p.outTangents(),p.isClosed())

  • Dan Ebberts

    September 25, 2020 at 9:04 pm in reply to: Link frame values to audio amplitude

    Time remapping expects time in seconds, not frames. I’d do it like this:

    levels = Math.round(thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider"));

    if (levels <= 5)

    f = 0

    else if (levels <= 10)

    f = 1

    else if (levels <= 15)

    f = 2

    else

    f = 3;

    framesToTime(f);

Page 132 of 1081

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