Forum Replies Created

Page 2 of 2
  • I had pretty much the same problem with one of my project. My solution was to use motion tracker.

    For you situation, this is what I recomend

    1. Add a black vertical line, center it to the dolphin’s fin and link it to the dolphin.
    2. Add an horizontal line at the water level.
    3. Use that horizontal line as a track matte for the vertical line. This will make it just a black dot at water level
    4. PreCompose your whole composition.
    5. Track Motion of that dot.
    6. Apply transformation of the track to a null.
    7. Copy that null into the composition of the animation
    8. Linked your wake layer to that null.

    Repeat process for the tail.

    In addition you could with expression animate the width of your wake depending on the y position of your dolphin. so that it grows as the dolphin passes the water line.
    To the scale of your wake layer:
    //put the position Y of your dolphin when the fin just touches the water line.
    y1 = 560 ;
    //put the position Y of your dolphin when you think the wake should be full size.
    y2 = 400;
    dolDepth = thisComp.layer("Dolphin layer name").transform.position[1];
    w = linear(dolDepth,y1,y2,0,100); //You can also try an ease interpolation instead of the linear one.
    [w,100]

    Hope that helps

  • That did it.
    Thanks Dan

  • Frederic Antoinette

    April 22, 2018 at 3:55 pm in reply to: Script to move keyframes to markers

    Hello, sorry its only now that I see you question.
    This a script not an expression.
    You should go to file->scripts->Open Scripts editor,
    and paste the code in there and run it.
    It is not a on the go continuous solution, every time you move the markers you have to rerun the script.

  • Frederic Antoinette

    December 1, 2016 at 2:08 pm in reply to: Texturing a Vector Shape

    Depending on your computer’s performance, it probably will slow down AE a bit more if all layers are shown at the same time, but AE can handle much more layers than that.
    Don’t know if it will make it faster or slow it down more, but it sure will help you handling all those layers; Depending on your animation you could try to group some layers by Pre-Composing them and turning on collapse transformation.

  • Frederic Antoinette

    November 30, 2016 at 6:59 am in reply to: Texturing a Vector Shape

    I can see two possible methods:
    Method 1: Track Matt
    Simply place your texture beneath your shape layer, make sure the z position of the shape and texture are the same. And change the TrkMatt for the texture to Aplha Matt.

    Method 2: Mask
    Create a new mask on your texture layer.
    Copy the path from the shape layer and paste it in the Mask of the texture layer. I find it easier to add a keyframe to the path and copy that to the Mask, sometime copy pasting path might not work without a keyframe.

  • Frederic Antoinette

    November 28, 2016 at 12:26 pm in reply to: Script to move keyframes to markers

    Wasn’t that easy after all,
    But spent the whole week end trying to figure it out. if any one is interested
    It works only for one property, if some one wants to enhance it to be able to select multiple properties you are welcome to do so.
    below is the code.
    Maybe someone can clean it up a little, this is the first time I write a script, and I’m pretty happy about the results.

    Works like that:
    Create your keyframes and add markers to what I call the origin layer.
    Create a null and place the markers with there corresponding comment to where you need them.
    Select the property from the origin layer and run the script

    Enjoy.

    var myComp = app.project.activeItem; // get the selected layer
    var layerIdx = myComp.selectedLayers[0].index; // grab index of selected layer
    var layer = myComp.layer(layerIdx); //set the selected layer
    var propIdx = layer.selectedProperties.length - 1; //Get how many properties are selected if more than one only the last one is retained, had to do this as for path it always select the group and the path
    var prop = layer.selectedProperties[propIdx]; // set variable to point to the last selected propertiies
    var oNumMarkers, origList, nL, layerList, mLayer, dupLayer;

    layerList = new Array();
    origList = new Array();

    dialog();

    function dialog(){

    // get how many layers there are in the composition
    nL = myComp.numLayers;

    // create a list of all the comp name for a drop down list
    for (var q = 1; q<=nL; q++) {

    layerList[layerList.length] = q + " - " + myComp.layer(q).name;
    }

    // create the popup window
    var myWin = new Window("palette","Select marked layer", undefined);
    var dd = myWin.add("dropdownlist",undefined,layerList) ;
    dd.selection =layerIdx - 2; // set selection to a layer higher than selected layer (assuming this is where you will placed your marked layer)
    var but = myWin.add("button",undefined,"Select Layer");
    but.onClick = function () {

    // This is where the fun starts
    app.beginUndoGroup ("Match keys to markers");

    mLayer = myComp.layer(dd.selection.index + 1); // set the layer continaing the final marker in position
    oNumMarkers = layer.property("Marker").numKeys; // get the total number of markers availble in the original layer

    // Create an array containing the value at each marker from the original layer
    for (var i = 1; i <=oNumMarkers; i++) {

    var name =layer.property("Marker").keyValue(i).comment;

    var time = layer.property("Marker").keyTime(i);

    var val = prop.valueAtTime(time,true);

    origList[origList.length] = {'name': name, 'time': time, 'value': val}

    }

    // Duplicate the selected layer, rename the duplicated layer same as original layer. and rename original layer to append Results at the end
    // Ended up to be easier to make a copy of the original layer, and then modify the original layer rather that modify the keys from the duplicated layer

    dupLayer = layer.duplicate();
    dupLayer.name = layer.name;
    layer.name = layer.name + "_Results";
    dupLayer.enabled = false; // Disable duplicated layer

    // Remove all markers and keyframes from the original layer, safe now since we have duplicated it and have already store all the data it contains in origList array
    for (var j = 1; j <=oNumMarkers; j ++){
    layer.property("Marker").removeKey(1);
    prop.removeKey(1);

    }
    //Place the correspondies keyframe to the corresponding markers by
    // Getting the first marker comment and time
    // then looping through origList to find the corresponding comment, and get its value
    // finally place that value on in the corresponding properties

    for (var k = 1; k <= mLayer.property("Marker").numKeys; k ++) {

    rName = mLayer.property("Marker").keyValue(k).comment;
    rTime = mLayer.property("Marker").keyTime(k);
    for (var r = 0; r < oNumMarkers; r++){
    if (rName == origList[r].name) {
    rVal = origList[r].value;
    }
    }
    prop.setValueAtTime(rTime,rVal);
    var mv = new MarkerValue(rName);
    layer.property("Marker").setValueAtTime(rTime,mv);
    }
    layer.moveBefore(mLayer); // move the result layer before the layer with the markers
    app.endUndoGroup();
    myWin.close();

    }
    myWin.center();
    myWin.show();
    }

  • I ended up figuring it out using the web to undestand sine curve.
    For those interested here is the code I used

    minV = 100; //Min scale value
    maxV = 250; //Max Scale Value
    S = 260; // Smallest position value where animation starts or end
    E = 1660; // Largest Position value where animation starts or end

    T = E-S;

    A = (maxV-minV)/2;
    B = 2*Math.PI/T;
    C = -(S+(T/4))*B;
    D = minV + A;

    x = thisLayer.toWorld(thisLayer.anchorPoint)[0];
    if (x >= S && x <= E) {
    s = A*Math.sin((B*x)+C)+D
    } else {
    s =100 }
    [s,s]

  • THIS IS BRILLIANT, why didn’t I thought of that, I then simply animate position and link them to one parameter, a null with an expression control.
    Thanks a lot.

Page 2 of 2

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