Forum Replies Created

Page 8 of 65
  • I think this will be the fastest way

    var comp = app.project.activeItem;

    var layers = comp.selectedLayers;

    if (layers.length == 0) {

    alert("You must select a layer");

    } else {

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

    if (layers[i] instanceof ShapeLayer) {

    var myTrim = layers[i].property("ADBE Root Vectors Group")("ADBE Vector Filter - Trim")

    ? layers[i].property("ADBE Root Vectors Group")("ADBE Vector Filter - Trim")

    : layers[i].property("ADBE Root Vectors Group").addProperty("ADBE Vector Filter - Trim");

    //and then://

    myTrim("ADBE Vector Trim Start").expression = "value";

    }

    }

    }

  • Andrei Popa

    May 27, 2022 at 6:53 am in reply to: Source Text work around for text

    Depends how far you are wiling to go. You want to make a script to highlight these texts? You want to use only expressions? How does After Effects know which words have different format, and which format?

  • I think this is what you need

    var comp = app.project.activeItem;

    var layers = comp.selectedLayers;

    if (layers.length == 0) {

    alert("You must select a layer");

    } else {

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

    if (layers[i] instanceof ShapeLayer) {

    var myTrim = layers[i].property("ADBE Root Vectors Group").addProperty("ADBE Vector Filter - Trim");

    //and then://

    myTrim("ADBE Vector Trim Start").expression = "value";

    }

    }

    }

  • Hi Allan.

    This should work

    myLayer.text.moreOption.fillANdStroke.setValue(2);
  • Andrei Popa

    April 18, 2022 at 6:07 am in reply to: Markers to trigger per-word reveal

    Hi Tom. You can try this. But this will only check spaces as word differentiators, not newlines.

    c = thisLayer;
    count = 0;
    for (i = 1; i <= c.marker.numKeys; i++) {
    if (c.marker.key(i).time > time) break;
    count++;
    }
    var result = value.split(" ").slice(0, count).join(" ");
    result;
  • Andrei Popa

    March 18, 2022 at 5:49 am in reply to: start a tool though scripting

    As of after effects 2017, this should be done with

    app.project.toolType = ToolType.Tool_Pen; 

    More on this at the page 52 of this document

    After Effects Scripting Guide (readthedocs.org)

  • Andrei Popa

    March 10, 2022 at 7:29 am in reply to: SOURCERECTATTIME FOR STRING

    Hi.

    I think this could work. You still need to do some testing.

    Add a scale animator to your text. Set units to index, set mode to subtract and scale to 0.

    Then on start and end add these expressions.

    txt = text.sourceText.replace(/\r/g,"");
    var parts = ["testing", "is a text"];
    if(time<0){
    val = txt.indexOf(parts[-Math.ceil(time+1)]);
    }else{
    val = value}
    val

    txt = text.sourceText.replace(/\r/g,"");
    var parts = ["testing", "is a text"];
    if(time<0){
    val = text.animator("Animator 1").selector("Range Selector 1").start+parts[-Math.ceil(time+1)].length;
    }else{
    val = txt.length}
    val

    And when you want to see the text width for some specific word, run:

    thisComp.layer("Text Layer").sourceRectAtTime(-1,false).width

    -1 means the first word from the array, -2 means the second and so on.

  • I don’t think you need a function for that. This should work:

    compToSearch.layer(layNS).index
  • Hi Dagur.

    Try changing the 4th row to this

    var rowCount = Math.round(targetObj.sourceRectAtTime(0,false).height/txtSize);

    Andrei

  • Andrei Popa

    February 12, 2022 at 7:55 am in reply to: Remove unnamed marks via script

    As far as I know, they are different because Adobe introduced the ability to access comp markers a few years later. The only big difference for us, the users, is that the markers for layers are accessed through layer.marker and the comp markers are accessed through comp.markerProperty. The result of these 2 calls is the same property type, so I assume we can treat them the same way.

Page 8 of 65

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