Forum Replies Created

Page 9 of 65
  • Hi Filip, that’s a great solution. I should treat text animators with more respect 😀

  • Andrei Popa

    February 11, 2022 at 11:42 am in reply to: Remove unnamed marks via script

    As Tomas said, there are 2 different approaches for layer/comp markers.

    If the markers are on a layer, you can select it and run this snippet

    var crtLayer = app.project.activeItem.selectedLayers[0];
    var markers = crtLayer.marker;
    for(var i = markers.numKeys; i>0; i--){
    if(markers.keyValue(i).comment == "") markers.removeKey(i)
    }

    If the markers are on the composition, select it or a layer inside it and run this snippet:

    var crtComp = app.project.activeItem;
    var markers = crtComp.markerProperty;
    for(var i = markers.numKeys; i>0; i--){
    if(markers.keyValue(i).comment == "") markers.removeKey(i)
    }
  • Hi Arav.

    You really need to be more explicit with that. What words? What is their criteria? How can you identify which one (maybe by index)?

  • Andrei Popa

    February 8, 2022 at 10:37 am in reply to: Auto-position type layers using bounding box?

    I would do this in the following way:

    AnchorPoint expression for the top layer

    var myWidth = sourceRectAtTime(sourceTime(0),false).width;
    var left = sourceRectAtTime(sourceTime(0),false).left;
    var myHeight = sourceRectAtTime(sourceTime(0),false).height;
    var top = sourceRectAtTime(sourceTime(0),false).top;
    [left+myWidth/2,myHeight+top]

    AnchorPoint expression for the bottom layer

    var myWidth = sourceRectAtTime(sourceTime(0),false).width;
    var left = sourceRectAtTime(sourceTime(0),false).left;
    var top = sourceRectAtTime(sourceTime(0),false).top;
    [left+myWidth/2,top]

    AnchorPoint expression for the mid layer

    var myWidth = sourceRectAtTime(sourceTime(0),false).width;
    var left = sourceRectAtTime(sourceTime(0),false).left;
    var myHeight = sourceRectAtTime(sourceTime(0),false).height;
    var top = sourceRectAtTime(sourceTime(0),false).top;
    [left+myWidth/2,myHeight/2+top]

    Position for top

    L = thisComp.layer(index+1);
    H = L.sourceRectAtTime(0,false).height;
    diff = 75;
    S = L.scale[1];
    P = L.position;
    [value[0], P[1] - diff - S * H * 0.005]

    Position for bottom

    L = thisComp.layer(index-1);
    H = L.sourceRectAtTime(0,false).height;
    diff = 75;
    S = L.scale[1];
    P = L.position;
    [value[0], P[1] + diff + S * H * 0.005]

    What we have done is:

    Put anchor point of the top layer to its bottom.

    Put anchor point of the bottom layer to its top.

    Put anchor point of mid layer in its mid.

    We have done these to have an easier position expression.

    The position of the top layer is the position of the mid minus half of it’s height minus your difference. We multiplied this by scale*0.01, because sourceRectAtTime does not include the scale in it’s value. So that 0.005 is just the 0.01 from scale multiplied with the 0.5 from height.

    Same for the bottom layer, but with plus instead of minus.

    You should take in consideration that these layers are in order in timeline: top, mid, bottom. If you have a different order, you should link your mid layer in both position expressions, on the first row. So instead of L = thisComp.layer(index-1); you will have something like L = thisComp.layer(“HERO TYPE”);

  • Andrei Popa

    January 29, 2022 at 9:38 am in reply to: “Stopping” a delay effect?

    I think you can put an if with time you want them to stop. Something like this:

    if(time <= endAnimation){
    //the expression you are currently using
    }else{
    valueAtTime(endAnimation)
    }

  • I do not think you can do it this way. Modifying the font size modifies the sourceRectAtTime, then the expression runs again and so on.

    What you could do is duplicate the text layer and get the sourceRectAtTime from that one (you can make it invisible). Then, based on the value, modify the font size on the current layer.

  • Andrei Popa

    January 22, 2022 at 7:42 am in reply to: Script Settings File

    It is.

    Create your javascript object holding the settings. Then to save it to a file you need to serialize it. You can do that with .toSource(). This creates a string that you can later use with eval(). So save the string created by myVar.toSource() in a txt file and when you need that variable again, read the content of the file and pass it to eval(), like this:

    var mySettings = eval(contentOfFile);

  • Andrei Popa

    January 19, 2022 at 8:04 am in reply to: Batch Resize Paragraph Text

    This should do it. Select your compositions in the project panel and run this. Replace [100,200] on row 13 with what values you need

    function changeParagraphSize(myComp,newSize) {
    for (var i = 1; i <= myComp.numLayers; i++) {
    var crtLayer = myComp.layer(i);
    var t = crtLayer("ADBE Text Properties")("ADBE Text Document");
    var td = t.value;
    td.boxTextSize = newSize;
    t.setValue(td);
    }
    }
    function changeParagraphSizeInProject(){
    var comps = app.project.selection;
    for(var i=0; i<comps.length; i++){
    changeParagraphSize(comps[i],[100,200])
    }
    }
    changeParagraphSizeInProject();
  • Andrei Popa

    January 15, 2022 at 8:14 am in reply to: Posterize Linear interpolation

    I don’t know of a posterize function, but you could use Math.floor().

    Assuming that the lineart of your B uses time as first parameter, you could define B like this:

    myFrameRate = 3;
    t = framesToTime(Math.floor(timeToFrames(time)/myFrameRate)*myFrameRate);
    B = linear(t, 5, 6, 0, 100);

    First I turn time to frames, so I can work with myFrameRate. Then I divide it by the myFrameRate value to create the steps. Then I multimplicate it by the same value to not alter the actual value of time. Then I make it time again, via framesToTime(), so I can use it in the linear function.

    If B is dependent on another value, not time, you could do something similar by using valueAtTime.

    There may be some simpler solution, but I can’t think of one.

  • I think the closest you can get with this is put an opacity expression to the layer that you want to make invisible. Something close to this. Here we take key 1 of property Scale of layer Reference layer

    var keyframeProp = thisComp.layer("Reference layer").property("Scale");
    var t = keyframeProp.key(1).time;
    time < t ? value : 0;
Page 9 of 65

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