Forum Replies Created

Page 63 of 65
  • The correct path would be
    $.evalFile("/Users/Dave/Desktop/RealEstate/roomnames.txt");

    Andrei

  • Andrei Popa

    August 24, 2017 at 3:30 pm in reply to: Attach anchorpoint to the center of the layer


    Here is a “crash course” for the sourceRectAtTime(time, false) function. In the picture you see the values it has for top, left, height and width. What you must remember is that while the anchor point is below the top of the layer the “top” value is negative. Also, if the anchor point is to the right of the left extremity, the left value is negative. You always have negative values for this variables while inside the rectangle. The x position is where the anchor is at its [0,0](where the anchor point is before you do any transformation to it). So for you to move it around, you only have to do some basic geometry. Here is a pic and also the values of x,y for all the positions you needed them. You can combine them as you like for different results.

    //x values
    //left
    x = thisLayer.sourceRectAtTime(time,false).left;
    //right
    x = thisLayer.sourceRectAtTime(time,false).width + thisLayer.sourceRectAtTime(time,false).left;
    //mid
    x = thisLayer.sourceRectAtTime(time,false).width/2 + thisLayer.sourceRectAtTime(time,false).left;

    //y values
    //top
    y = thisLayer.sourceRectAtTime(time,false).top;
    //mid
    y = thisLayer.sourceRectAtTime(time,false).height/2 + thisLayer.sourceRectAtTime(time,false).top;
    //bottom
    y = thisLayer.sourceRectAtTime(time,false).height + thisLayer.sourceRectAtTime(time,false).top;

    Andrei

  • Andrei Popa

    August 23, 2017 at 8:06 am in reply to: Slider control updating value

    After Effects expressions have no memory. Each frame they execute your code from zero. Nothing is saved over time except time. But i think that there is some workaround for your problem. You can execute the code for the whole addition each frame. The downside is that if you have a very long composition it will start running slow.

    keyFrameVar = thisComp.layer("Black Solid 2").effect("Sound Keys")("Output 3")
    frRate =1/ thisComp.frameDuration;
    keyFrameSum = 0; //
    for (i=1; i

    Andrei

  • Andrei Popa

    August 22, 2017 at 7:07 pm in reply to: Slider control updating value

    If you want to create some sort of dependencie between frames, i think you should use time. something like
    keyFrameVar = thisComp.layer("Black Solid 2").effect("Sound Keys")("Output 3");
    frameNumber = time/thisComp.frameDuration;
    value + keyFrameVar*frameNumber

    this way you multiply keyFrameVar by the number of frames(like adding it for each frame)

    Andrei

  • Well. Baby steps. So you have a rectangle on a text layer. Then another text layer comes in and you want it to take the size of the new text? If so, you should use an ease function. Something like this

    dur = 0.33; //about ten frames, assuming that you are working on a 30 fps project
    easeStart = thisComp.layer("secondTextLayer").inPoint;
    easeEnd = easeStart + dur;
    startValue = [thisComp.layer("firstTextLayer").sourceRectAtTime(time,false).width,thisComp.layer("firstTextLayer").sourceRectAtTime(time,false).height]
    endValue = [thisComp.layer("secondTextLayer").sourceRectAtTime(time,false).width,thisComp.layer("secondTextLayer").sourceRectAtTime(time,false).height]
    if (time< easeStart) startValue else ease(time,easeStart,easeEnd,startValue,endValue);

    this is for 2 layers. If you have many, i would suggest arranging them one after another and using the index in a for loop. If you do have many layers and can’t figure this out, tell me and i will try to find a solution.

    Andrei

  • Andrei Popa

    August 16, 2017 at 3:14 pm in reply to: Attach anchorpoint to the center of the layer

    The solution for making the anchor point always in the middle is
    tempx = thisLayer.sourceRectAtTime(time,false).width/2 + thisLayer.sourceRectAtTime(time,false).left;
    tempy = thisLayer.sourceRectAtTime(time,false).height/2 + thisLayer.sourceRectAtTime(time,false).top;
    [tempx,tempy]

    but you may run into some problems with the position by changing it with expressions. You may have to also alter the position expression.

    Andrei

  • Andrei Popa

    August 16, 2017 at 7:28 am in reply to: How to turn off and on an expression randomly

    You could add 2 “Slider Control” controls to this layer. Name them “Cycle duration” and “Expression duration”. The expression then for this would be:
    modValue = Math.floor(time%effect("Cycle duration")("Slider"));
    if(modValue < effect("Expression duration")("Slider") ){
    minAudio = 0;
    maxAudio = 100;
    minStretch = 100;
    maxStretch = 125;
    audioLev = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
    s = linear(audioLev, minAudio, maxAudio, minStretch, maxStretch);
    [s,s,s];
    }
    else value;

    So the time that the layers stays still is “Cycle duration” minus “Expression duration”. Play with this 2 until you get something you like(Expression duration should always be smaller than Cycle duration). If, for example, you set them to be 15 and 9, the layer will scale up and down 9 seconds and then stay still until it reaches 15 seconds, and start moving again. If you add the modValue to the value at the end, you make the layer grow a bit each second.

    Andrei

  • Is this what you are looking for? Because i don’t quite understand your problem.
    y = thisComp.layer("57%").effect("Slider Control")("Slider");
    [100, y*57/100]

    this will show 0 at 0, and 57 at 100. Replace 57 with anything you want for different result at 100.

    Andrei

  • You are welcome. Glad i could help.

    Andrei

  • Try this
    time*500+value

    Andrei

Page 63 of 65

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