Forum Replies Created

Page 68 of 1081
  • Dan Ebberts

    November 16, 2022 at 1:11 am in reply to: Trigger animation by trim path

    If you’re animating the Trim Path’s End property with linear keyframes, there’s likely a more efficient way to do it.

  • Dan Ebberts

    November 15, 2022 at 10:32 pm in reply to: Trigger animation by trim path

    The key to something like this is for the expression to calculate when the Trim Paths reached the triggering threshold for this particular layer and calculate the time since that event, and use that to drive the animation. Worst case, you could do something like this:

    dur = .5; // duration of scale-up (in seconds)
    s = 0;
    x = thisComp.layer("Timeline Animation").effect("Trim Path to Pixels")("Slider");
    if (x > transform.xPosition){
    t = time - thisComp.frameDuration;
    while (x.valueAtTime(t) > transform.xPosition){
    t -= thisComp.frameDuration;
    }
    delta = time - t;
    s = linear(delta,0,dur,0,100);
    }
    [s,s]
  • Dan Ebberts

    November 14, 2022 at 4:38 pm in reply to: Target an effect without the name of it

    I’m not sure, but you might be after something like this:

    effect(effect("Nslider").propertyIndex-1).name
  • Dan Ebberts

    November 12, 2022 at 12:26 am in reply to: Add Effect to layers with expressions erros in all comps

    It’s been a while since I’ve done much with plugin code, but I seem to recall that when you add a new control to your plugin, you just need to make and assign it a new, unique id and it should be backwards compatible. It sounds like you may have had a different experience.

  • I think the problem might be that when xfreq and yfreq point to individual x and y values of the point control, xfreq.numKeys and xfreq.key() no longer make sense.

  • Dan Ebberts

    November 11, 2022 at 8:02 pm in reply to: Add Effect to layers with expressions erros in all comps

    You’ll need a recursive property sniffer to check for expression errors. Something like this should be close:

    var foundOne;
    function processProperty(theProp){
    if (theProp.propertyType == PropertyType.PROPERTY){
    if (theProp.canSetExpression && theProp.expressionError != ""){
    foundOne = true;
    }
    }else{ // must be a group
    for (var i = 1; i <= theProp.numProperties; i++){
    if (! foundOne) processProperty(theProp.property(i));
    }
    }
    }
    var myComp, myLayer;
    for (var i = 1; i <= app.project.numItems; i++){
    if (app.project.item(i) instanceof CompItem){
    myComp = app.project.item(i);
    for (var j = 1; j <= myComp.numLayers; j++){
    myLayer = myComp.layer(j);
    if (! myLayer.locked){
    foundOne = false;
    processProperty(myLayer);
    if (foundOne){
    myLayer.property("Effects").addProperty("ADBE Fill");
    }
    }
    }
    }
    }
  • Dan Ebberts

    November 11, 2022 at 5:21 am in reply to: Math.Max instead of if else

    I think you’d replace the last line with this:

    s = Math.max(xclamp,yclamp);
    [s,s]
  • The only other (besides sourceRectAtTime()) tool I know of is sampleImage(). It’s really inefficient because it has to do a lot of calculations, but you can use it to find the non-zero alpha extents of your layer. This expression will give you the left, right, top, and bottom extents. You’ll need to tailor it to your exact requirements.

    L = thisComp.layer("target");
    h = L.height/2;
    w = L.width/2;
    for (i = 0; i < L.width; i++){
    if (L.sampleImage([i,h],[.5,h])[3]>0) break;
    }
    left = i;
    for (i = L.width-1; i >= 0; i--){
    if (L.sampleImage([i,h],[.5,h])[3]>0) break;
    }
    right = i;
    for (i = 0; i < L.height; i++){
    if (L.sampleImage([w,i],[w,.5])[3]>0) break;
    }
    top = i;
    for (i = L.height-1; i >= 0; i--){
    if (L.sampleImage([w,i],[w,.5])[3]>0) break;
    }
    bottom = i;
  • Dan Ebberts

    November 9, 2022 at 5:28 pm in reply to: How to multiply “slider” with Expression?

    This should work:

    time*Math.pow(10,effect("slider 2")("Slider"))
  • Dan Ebberts

    November 9, 2022 at 4:44 pm in reply to: Bezier Warp Symmetry Expressions

    Hmmmm. I can’t picture how that would work. So the expression for each control would include its own keyframed value plus the appropriate symmetrical controls? I think that would set up the kind of viscous cycle loop that expressions can’t resolve. Kind of like when you try to create a radio button control out of checkboxes. The expressions end up fighting each other.

Page 68 of 1081

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