Forum Replies Created

Page 98 of 1081
  • Dan Ebberts

    February 14, 2022 at 3:17 am in reply to: Mask size(width x hight)via script

    I suppose you could create a shape layer (with a single click of the pen tool) and link its path to the mask with an expression. You could then get the dimensions with sourceRectAtTime(), and even turn the eyeball off for the shape layer so it doesn’t show up in the comp.

  • Dan Ebberts

    February 10, 2022 at 7:16 pm in reply to: Decoding Bounce Expression

    It looks like you pasted it in twice, but in any case, the expression looks for the most recent, previous keyframe, calculates the velocity coming into that keyframe, and uses that velocity to calculate a decaying sine wave oscillation that gets added to the current value. The oscillation gets get off abruptly after 1 second.

  • Dan Ebberts

    February 10, 2022 at 6:27 pm in reply to: Stop wiggle after x frames based on layers in point

    Try replacing the first line with this:

    stopFrame = timeToFrames(inPoint) + 100;
  • Something like this maybe:

    L = thisComp.layer("Null 1");

    p = L.transform.position;

    d = p.valueAtTime(time-inPoint) - p.valueAtTime(L.inPoint);

    value + d

  • Dan Ebberts

    February 9, 2022 at 8:27 pm in reply to: difference between = and ==

    a = sets a to a value

    a == compares a to something, returning true if they’re the same

  • It could, but that would require a UI for the script, which is a bit of work. Here’s how the basic functionality might look though:

    function setKF(){

    var myComp = app.project.activeItem;

    if (! (myComp && (myComp instanceof CompItem))){

    alert("No comp active.");

    return;

    }

    var myProps = myComp.selectedProperties;

    if (myProps.length == 0){

    alert("No property selected.");

    return;

    }

    var myProp = null;

    for (var i = 0; i < myProps.length; i++){

    if (myProps[i].numKeys >= 2){

    myProp = myProps[i];

    break;

    }

    }

    if (myProp == null){

    alert ("No property with 2 or more keyframes selected.");

    return;

    }

    var tStart = myComp.workAreaStart;

    var tEnd = tStart + myComp.workAreaDuration;

    var myExpr = "t = linear(time," + tStart + "," + tEnd + ",key(1).time,key(numKeys).time);\rvalueAtTime(t)";

    myProp.expression = myExpr;

    }

    setKF();

  • Do you mean the work area? Expressions don’t have access to the work area start and end times. Scripting does, so you could do it with a script, but it wouldn’t adjust automatically when you change the work area.

  • Dan Ebberts

    February 6, 2022 at 3:20 am in reply to: Increase slider value by one, every 90 frames

    Try this:

    Math.floor(timeToFrames(time-inPoint)/90) + 1
  • Dan Ebberts

    February 4, 2022 at 7:46 pm in reply to: Align multiple 3D layers on X and Y only

    Maybe:

    p = thisComp.layer("Layer A").position;

    c = thisComp.activeCamera.position;

    v = normalize(p - c);

    c + v*((value[2]-c[2])/v[2])

  • Dan Ebberts

    February 1, 2022 at 5:19 pm in reply to: Get size of 3D layer pushed back in z-space

    Something like this maybe:

    L = thisComp.layer("3D Layer");

    upperLeft = L.toComp([0,0,0]);

    lowerRight = L.toComp([L.width,L.height,0]);

    w = lowerRight[0] - upperLeft[0];

    h = lowerRight[1] - upperLeft[1];

Page 98 of 1081

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