Forum Replies Created

Page 61 of 65
  • Andrei Popa

    October 30, 2017 at 2:27 pm in reply to: Animated sound bars responded to the music

    You should rightclick your audio layer>Keyframe Assistant> Convert Audio to Keyframes. This will create a new layer with the left, right and both channel proprieties. Make a bar, put the anchor point to one end, and pickwhip the size expression to one dimension of the new layer created. You must probably multiply this pickwhip value by some number(look at the top value of the channel you pickwhiped and divide 100 to that. This should be the multiplier).
    So your expression on the scale should look something like this:

    thisComp.layer("Audio Amplitude 2").effect("Both Channels")("Slider")*3;
    if(x<100) [x,value[1]] else [100,value[1]]

    The if is there to make sure your bar does not go over 100 in size, even if the sound comes out really loud.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 24, 2017 at 7:39 pm in reply to: Need to loop wiggle to create seamless animation

    You put your layers in a precomp. Add time-remap to that precomp. Add this expression to the time-remap.
    cycleDuration = 2;
    cycleDuration-Math.abs((time-inPoint)%cycleDuration *2-cycleDuration )

    You can modify the duration of the loop by changing the 15 in the first line. This is basically a “pingpong” loopOut with the duration of 15. As an alternative, you can set a keyframe at 0 and one at 15 seconds of the timeremap propriety of your precomp, and add this expression:
    loopOut("pingpong")

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 24, 2017 at 3:43 pm in reply to: multiple random numbers but never the same

    I forgot to explain myself. What we basically do is take that 0-99 array and shuffle its elements. That way we do not get any double. And then we take a chunk out of it, correspondent with the indexes of your layer. This won’t work if any of your layer has the index bigger than 100.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 24, 2017 at 2:15 pm in reply to: multiple random numbers but never the same

    The way i would do it is this. First make a layer named “Number Control”. In the text source expression field write this
    var a = new Array;
    for (i = 0; i<100;i++) a[i]=i
    function shuffle(array) {
    var currentIndex = array.length, temporaryValue, randomIndex;

    // While there remain elements to shuffle...
    while (0 !== currentIndex) {

    // Pick a remaining element...
    randomIndex = Math.floor(random() * currentIndex);
    currentIndex -= 1;

    // And swap it with the current element.
    temporaryValue = array[currentIndex];
    array[currentIndex] = array[randomIndex];
    array[randomIndex] = temporaryValue;
    }

    return array;
    }
    shuffle(a);
    "["+a.toString()+"]"

    Then use this expression in each of your layer

    var x= eval(comp("Comp 1").layer("prim").text.sourceText.toString());
    if (time<5) x[index] else value

    credits for the shuffle function https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 17, 2017 at 10:02 am in reply to: Elastic rope effect on a text

    Thanks a ton Brendon. Did not know about the path thing. Can’t believe i struggled so many times doing efffects that could be done so easy with a mask path :O

    Andrei

  • Andrei Popa

    October 13, 2017 at 7:35 am in reply to: How get a random position with fixed numbers

    I don’t know how you save your variables. I will asume that you declare them inside your expression. This first expression if for using same position of x and y(third x matches third y)
    xArray = [100,300,500,700];
    yArray = [200,400,600,800];
    randomPosition = Math.round(random()*(xArray.length-1));
    x = xArray[randomPosition];
    y = yArray[randomPosition];
    [x,y]

    This code is for using random x and random y.

    xArray = [100,300,500,700];
    yArray = [200,400,600,800];
    xrandomPosition = Math.round(random()*(xArray.length-1));
    yrandomPosition = Math.round(random()*(xArray.length-1));
    Math.floor(random()*xArray.length);
    x = xArray[xrandomPosition];
    y = yArray[yrandomPosition];
    [x,y]

    Feel free to ask if you need any further explanation.

    Andrei

  • I personally would create the precomp first and then add all the layers inside it. That way you don’t need to worry if you selected the correct layers and such. So steps would be create the precomp and add it to the active composition and set the blending mode
    var myPrecomp =app.project.items.addComp(name, width, height, pixelAspect, duration, frameRate) ;
    var myPrecompLayer = app.project.activeItem.add(myPrecomp);
    myPrecompLayer.blendingMode = BlendingMode.SCREEN ;

    Then, inside it add all the layers. Crefull, since here you have to use the composition variable(myPrecomp), not the layer one.
    myPrecomp.layers.add() //or maybe addText, addShape or whatever you need
    I hope it helped,

    Andrei

  • Andrei Popa

    October 9, 2017 at 2:52 pm in reply to: Floating point trouble

    Maybe you should differently declare the workDur. figure out the number of frames you wish to have(i named it framesNumber) and try something like
    workDur = framesNumber*app.project.activeItem.frameDuration

    Andrei

  • Andrei Popa

    October 9, 2017 at 11:04 am in reply to: Floating point trouble

    I’m not sure why the comp has this slightly longer duration. Maybe due to framerate or something, they can not exactly divide it. But i don’t know why this 40 nanoseconds trouble you 😀

    Andrei

  • Andrei Popa

    September 26, 2017 at 8:36 am in reply to: follow a null with delay for another layer

    When you pickwhip a position to another position, the value as number of the parented position will change to the values of the parent position. The numbers will be the same, but if the layer containing the parented position is also parented to another layer, the positions visually will not be the same. Because when you parent a layer to another layer, the position coordinates refer to the position of the parent. When the layer is not parented, the position coordinates refer to the top left corner of the composition.

    Andrei

Page 61 of 65

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