Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Help with expression to average trackers

  • Help with expression to average trackers

    Posted by Nisha Samuel on July 11, 2005 at 3:25 am

    Hi,

    I’ve been given an expression to average the results from multiple stabilisers. Except that I keep gettin an error saying

    “AE warning: invalid numeric result (divide by zero?)
    Error occured at line 15”

    As I didn’t write this myself, any help with this would be great! I am basically highlighting _______, and pick whipping to each tracker/stabiliser result. Then numOfStabilizers = 0; changing 0 to the amount of stabilisers.

    //expression begins

    apArr = [_______,________,_______ ];
    numOfStabilizers = 0;
    x = 0;
    y = 0;

    for(i = 0; i <= apArr.length - 1; i++) { numOfStabilizers++; x += apArr[i][0]; y += apArr[i][1]; } [x,y]/numOfStabilizers //end

    Colin Braley replied 20 years, 10 months ago 3 Members · 2 Replies
  • 2 Replies
  • Realethan

    July 11, 2005 at 12:41 pm

    The expression looks solid, are you pick-whipping the tracker’s “attach-point”?

  • Colin Braley

    July 11, 2005 at 4:27 pm

    Hey I wrote that expression 🙂 Ethan is right, make sure you pick whip to the attatch point property. Also there is no need to change the numOfStablilizers. I wrote the code so that all you have to do is use the pick whip and it will check how many stablizers you have and divide by that number. Just leave all the code as is, except do the pick-whipping.
    ~Colin

    If you have any questions on how the code works ill explain that too if you want

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