Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Combining two expressions

  • Combining two expressions

    Posted by Pdebster on September 20, 2007 at 1:10 pm

    I’m trying to combine two scripts to achieve the path shown in this image: https://members.shaw.ca/pdebay/spiral.jpg

    I started with a ‘bounce between two points’ expression:
    origin = [thisComp.width/2, thisComp.height/2];
    dest = effect(“end”)(“Point”);
    amp=24;
    decay=1.2;
    dest + (origin – dest)*(Math.exp(-decay*time)*Math.cos(amp*time));

    and tried to combine (by way of an average) with a circular motion (orbit around middle of comp) expression, but the result is the bottom path in the image.

    Any help is appreciated in achieving the top path.

    thanks, Pdebster

    Pdebster replied 18 years, 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    September 20, 2007 at 3:02 pm

    Not sure about your setup, but play around with this:

    rMax = 150;
    decay = .3;
    freq = 6;
    aStart = 0;
    aRate = 270;
    offsetFactor = 10;

    r = rMax/Math.exp(time*decay);
    a = degreesToRadians(aStart + aRate*time);
    offset = (r/offsetFactor)*Math.sin(freq*time*Math.PI*2);
    center = [thisComp.width/2, thisComp.height/2];
    center + [Math.cos(a),Math.sin(a)]*(r + offset);

    Dan

  • Pdebster

    September 20, 2007 at 4:39 pm

    Dan,

    That works beautifully – it is a true pleasure for all of us to have access to your abilities and your generosity.

    I will now attempt to figure out your handiwork,
    regards, Pdebster

  • Pdebster

    September 20, 2007 at 5:47 pm

    Through the magic of Dan’s expression and nab’s Create Custom Effect script, I created an .ffx for creating a crenelated or ‘scalloped’ spiral effect through the write-on effect. Who knows if it’s useful in and of itself, but it goes to show the power under the AE’s hood (and of online collaboration).

    I’ve posted an image here:
    https://members.shaw.ca/pdebay/cren.jpg

    anyone can email me pdebay@shaw.ca if they want creation/install instructions (you’ll have to tinker with the PresetEffects.xml file at your own risk)

    thanks again, Dan and nab,
    Pdebster

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