Forum Replies Created

Page 28 of 65
  • Andrei Popa

    June 3, 2020 at 2:51 pm in reply to: connect rotation value to number generator

    I think you need to link a number to another and the line to only one of the numbers. Let’s say you link it to the one on the left. This should work. The “leftNumber” is the number of the layer on the left.
    This expression goes to the rotation of your needle

    numberVal = thisComp.layer(“leftNumber”).text.sourceText.value;
    linear(numberVal,0,100,-90,90)

    The right number should have this to it’s text, so it automatically updates to the one on the left:

    numberVal = parseInt(thisComp.layer(“leftNumber”).text.sourceText.value);
    100-numberVal;

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 3, 2020 at 7:01 am in reply to: Time remap based on velocity/direction?

    I dont understand why it jumped only in 2 sprites in your case. It is build for 5 cases. UP DOWN LEFT RIGHT NEUTRAL. On each frame, it shows the one that is bigger(if the object goes left with 45-something degrees difference to horizontal, it shows left. If it goes with 45+something it shows up )
    My expression is very similar to your. I just used the .velocityAtTime() to get the direction instead of accessing valueAtTime(time-frame)
    The 50 pixels per second is for the case in which the speed is very low, case in which it will show the neutral pose.

    Now for the problem with your case. You must go back in time frame by frame until you find a value that is not zero(for the speed) and make the current value that value. This will create long render times if your object sits in place a lot.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 2, 2020 at 8:14 am in reply to: maintaining distance dynamically

    If your text is center justified, this expression to position should work.

    Left bracket
    textLayer = thisComp.layer(index+1);
    textRect = textLayer.sourceRectAtTime(time,false);
    textPos = textLayer.position;
    diff = 20;
    [textPos[0]-textRect.width/2-diff,value[1]]

    Right bracket
    textLayer = thisComp.layer(index+1);
    textRect = textLayer.sourceRectAtTime(time,false);
    textPos = textLayer.position;
    diff = 20;
    [textPos[0]+textRect.width/2+diff,value[1]]

    On the first row you must link your text layer. Select the ” thisComp.layer(index+1)” part and pick-whip your text layer.
    You can modify diff to increase/decrease the distance between the bracket and the text.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 1, 2020 at 7:34 am in reply to: adding multiple layers and effects with scripts

    It is pretty complicated to serialize a project as you describe here. There is an alternative, but it costs.
    https://aescripts.com/compcode/

    If you want to do it by yourself, you would have to create a variable(maybe a JSON file) with all the characteristics of the layers and effects.(names, size, position etc).
    There isn’t anything AE provides right now that could save your rig inside a jsx.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 28, 2020 at 6:28 pm in reply to: How to highlight one word in the text?

    Add a text animator.
    On the selector, add expression selector.
    Inside the expression of the expression selector write this. Modify the “asd” from row 1 with what word you want but do not remove anything else except “asd”.


    var regex = /.asd/g;
    var t = text.sourceText;
    var splitText = t.split("\r");

    function indexMatched(index){
    var matched = false;
    var match;
    while ((match = regex.exec(t)) !== null){
    matched |= match.index

    Andrei
    My Envato portfolio.

  • You need to encapsulate the values from your second expression in a variable and pass them to the first. Did not test this, but i think it should work.

    try{
    myPath = "G:/Workflow/Working/Infografik/Data/source.txt";
    $.evalFile(myPath);
    myVal = eval(thisComp.name)[0];
    }catch(err){
    myVal = "MISSING";
    }
    text.sourceText.style.setFontSize(comp("Infografik").layer("Controls").effect("M Text Center Font Size")("Slider")).setText(myVal)

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 24, 2020 at 6:42 am in reply to: Inherit Value from different Composition

    Here is some workaround so you don’t have to write the expression by hand.

    1. Copy the layer holding the color information to your current comp.
    2. Pickwhip to the color property.
    3. From the start of the expression generated, replace “thisComp” with “comp(Comp1)”.
    4. Delete the copied layer.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 22, 2020 at 7:00 am in reply to: Rename layer

    app.project.activeItem.selectedLayers[0].name = "BG"

    app.project.activeItem.selectedLayers[0].name = "Matte"

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 22, 2020 at 6:44 am in reply to: Expression to smooth a crawl text (horizontal)?

    If what you want is to change this to modify x instead of y, try this

    speedPxPerFrame = 2;
    currentFrame = (time - inPoint)/thisComp.frameDuration;

    value - [currentFrame*speedPxPerFrame,0]

    If you want to change directions, change the sign in the last line

    speedPxPerFrame = 2;
    currentFrame = (time - inPoint)/thisComp.frameDuration;

    value + [0, currentFrame*speedPxPerFrame]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 22, 2020 at 6:40 am in reply to: Use Wiggle to blink characters in a line of text

    posterizeTime(2)
    var numChars = 20;
    var solution = '';
    for(var i=0; i< numChars; i++){
    solution+=Math.round(random())
    }

    solution

    The argument of the posterizeTime is how many times a second you want it to change.

    Andrei
    My Envato portfolio.

Page 28 of 65

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