Forum Replies Created

  • In case anyone else needs a solution to this, enter the below code into the Position property of your keyframed object.

    Many thanks to the brain of Filip Vandueren who came up
    with this solution.

    t1= key(1).time;
    t2= key(numKeys).time;

    x1=key(1).value[0];
    x2=key(numKeys).value[0];

    linear_x=linear(time, t1, t2, x1, x2);

    precision = 3; // make this higher (16) if you need Motion blur
    fd = thisComp.frameDuration/precision;

    y=key(1).value[1];

    for (t=t1; !(t>t2); t+=fd) {
    v=valueAtTime(t);
    if (v[0]>=linear_x) {
    y=v[1];
    break;
    }
    }

    [linear_x,y];

  • It works perfectly! This really helps me out, thank you so much.
    Last time I coded was Basic language at school but this has renewed my interest.

  • Thanks for pointing that out.
    It’s shortened length makes it a little less scary at least…

  • Wow, thanks. That is complex!
    I can’t try it right now but will later today…

  • You might be thinking along the right line…

    But I have 5 more graphs to make and I believe a solution exists that could avoid all the key framing, and if a solution is found it’s something that I think could be helpful for people in other projects.

    If there was a way to automatically create keyframes at the intersection of two objects (the vertical line and the curve) that would be ideal.

    Or, if the moving object could automatically reference the Y value of the curve, but the X value of the moving line.

  • Thanks for suggesting your idea. However the dot does need to be a shape object as I need it to look a particular way and a light sweep will not allow for that.

    I do understand what you are saying about the fact that the object is technically travelling at a constant speed already, in terms of its XY axes.

    However the speed in relation to a particular axis varies. It’s an interesting problem, and deceptively complex. And I have no idea how to solve it.

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