Forum Replies Created

Page 39 of 65
  • Andrei Popa

    January 29, 2020 at 8:17 am in reply to: Import a file + a couple more steps script

    Something like this maybe


    newFootageItem = app.project.importFile(new ImportOptions(File.openDialog()));
    newFootageItem1 = app.project.importFile(new ImportOptions(File.openDialog()));
    myCrtComp = app.project.activeItem;
    var layer1 = myCrtComp.layers.add(newFootageItem);
    var layer2 = myCrtComp.layers.add(newFootageItem1);
    layer1.guideLayer = true;
    layer1.locked = true;
    layer2.guideLayer = true;
    layer2.locked = true;

    Andrei
    My Envato portfolio.

  • Andrei Popa

    January 29, 2020 at 8:08 am in reply to: Select path of a shape layer via script

    I don’t think you need a script for that. You have 2 options:

    1. Select the pen tool(G) and then select your layer. It also work if your layer is selected and you press G.
    2. With your Selection tool(V) double click on your path in the viewer.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    January 29, 2020 at 8:03 am in reply to: Can check if a word exceeds the paragraph width?

    I think I was not clear enough, but you gave me an idea anyway.

    I had a boxText paragraph that had a pretty small width. I was afraid that some words the client may use may overextend and be broken in half.

    I ended up creating an invisible text layer that had as value the longest word from the boxText.
    I then created a ratio variable that was botTextWidth/longestWordWidth. And i multiplicated the font size with this ratio if it were smaller than 1.

    Thank for the hint.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    January 28, 2020 at 2:12 pm in reply to: Remove HTML elements from json text

    Maybe you need to use the escape character before /, like this: “<\/em>”

    Andrei
    My Envato portfolio.

  • Andrei Popa

    January 24, 2020 at 1:18 pm in reply to: Using frames instead of seconds in a script

    comp.frameDuration is how long a frame is. Basically time = 2*comp.frameDuration means second frame.

    var ActiveComp = app.project.activeItem;
    var frameDuration = ActiveComp.frameDuration;
    var selectedLayers = ActiveComp.selectedLayers;
    var numLayers = selectedLayers.length;
    var currentTime = selectedLayers.time;
    var time = app.project.activeItem.layer(1).time *ActiveComp.frameDuration; ;

    if(numLayers == 0){
    alert("Select a layer");
    } else {
    selectedLayers[0].property("ADBE Transform Group").property("ADBE Opacity").setValueAtTime(time,100);
    selectedLayers[0].property("ADBE Transform Group").property("ADBE Opacity").setValueAtTime(time+2*frameDuration,0);
    selectedLayers[0].property("ADBE Transform Group").property("ADBE Opacity").setValueAtTime(time+4*frameDuration,100);
    };

    Andrei
    My Envato portfolio.

  • Andrei Popa

    January 24, 2020 at 1:10 pm in reply to: Add characters at the beginning of the second line

    You can do this:

    Add a text animator to your layer. Go to Range Selector>Advance> and change Units to Index and Based on to Lines.
    Set Start to 1.

    Now, if you want only second line to be moved to the right, set End to 2. If you want all your subsequent lines to go a bit to the right, set this End value to something high(the max number of lines you will ever have. Let’s say 10).

    Now go to Animator 1> Position and modify the first value of the position until you are happy with the result(this will vary based on your font and font size). You should do this with a text that starts with “.

    Now alt+click this Animator1>Position and add this as an expression. You need to copy-paste the double quotes inside that expression because some fonts have different in/out quotes.

    text.sourceText.substring(0,1) == '“' ? value : [0,0];

    Andrei
    My Envato portfolio.

  • I knew they only upgraded the expression engine, not the scripting one. The question is why does filter work on some computers… On mine, it doesn’t. And it shouldn’t.

    Maybe you have another script installed on some computers that uses a prototype filter() function. If a script is loaded in AE, you can use public variables and function from that inside another script. So you could even use a prototype method. That is the only scenario that i can think of.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    January 19, 2020 at 2:05 am in reply to: Updating Expressions over time

    This would be the first expression fixed:

    inPoints=[]
    inPoints[1]=thisComp.layer("Layer 1").inPoint;
    inPoints[2]=thisComp.layer("Layer 2").inPoint;
    inPoints[3]=thisComp.layer("Layer 3").inPoint;
    inPoints[4]=thisComp.layer("Layer 4").inPoint;
    inPoints[5]=thisComp.layer("Layer 5").inPoint;
    i=2;
    lastGap=0;
    sum=0;
    while(inPoints[i]

    And this would be a neat way to do it.
    Put all those sequenced layers one after another in the timeline.init must be the index of the first one, layersNumber must be the nuber of the layers. The commented part of row 12 is the average. If you need the average, just take that commented text and replace the one in front.

    init=3;//first layer of the sequence
    layersNumber = 5 ;//The number of layers for the sequence
    i=init+1;
    lastGap=1;
    sum=0;
    while(thisComp.layer(i).inPoint

    Andrei
    My Envato portfolio.

  • Andrei Popa

    January 18, 2020 at 12:02 pm in reply to: Updating Expressions over time

    Im on the phone, so that may get some things wrong but here is the idea:

    inPoints[1]=thisComp.layer("Layer 1").inPoint*50;
    inPoints[2]=thisComp.layer("Layer 2").inPoint*50;
    inPoints[3]=thisComp.layer("Layer 3").inPoint*50;
    inPoints[4]=thisComp.layer("Layer 4").inPoint*50;
    inPoints[5]=thisComp.layer("Layer 5").inPoint*50;
    i=2;
    lastGap=0;
    sum=0;
    while(inPoints[i]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    January 15, 2020 at 4:19 pm in reply to: long expression for if/then/else

    Cu placere!
    Spor la animat!

    Andrei
    My Envato portfolio.

Page 39 of 65

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