Forum Replies Created

Page 83 of 277
  • Filip Vandueren

    August 13, 2020 at 10:12 pm in reply to: Pause & continue to an expression

    Hi Oguz,

    It was a pretty tough one, too bad that loopOut() doesn’t take a third parametr for time, so I had to rewrite code to mimic what loopOut(“offset”) does.
    This is the final expression for rotation:


    ch=effect("Freeze")("Checkbox"); // point to your checkbox
    n = ch.numKeys;

    // start-stop time variable adapted from Dan's Speed control integrator
    if (n<2) {
    t=time * !ch.value;
    } else {
    t=ch.key(2).time * !ch.key(1).value;
    for(i=2; i time) break;
    t+=(ch.key(i+1).time - ch.key(i).time) * !ch.key(i).value;
    }
    t+=!ch.value*(time-ch.key(i).time);
    }

    // fake loopOut(offset):
    if (numKeys>1 && t>key(numKeys).time) {
    k1 = key(1).time;
    knk = key(numKeys).time;
    delta = key(numKeys).value - key(1).value;

    // have to do stupid conversion to framenumbers because of % vs / rounding errors }:-(
    loopTime = timeToFrames(k1) + (timeToFrames(t-k1) % timeToFrames(knk-k1));
    loops = Math.floor(timeToFrames(t-k1) / timeToFrames(knk-k1));
    // now convert back
    l = valueAtTime(framesToTime(loopTime)) + (loops*delta);
    } else {
    l = valueAtTime(t);
    }

    Right now the code works that when the checkbox is ON -> time stops. That’s why I named it freeze.
    To invert the behavior (time freezes when it’s OFF) change every !ch.value into ch.value

  • Filip Vandueren

    August 13, 2020 at 8:44 am in reply to: From PSD to AE, Flickering Image Sequence

    Does the character also have position keyframes ?
    Then try adding this expression to its position:


    posterizeTime(12);
    value;

    In the case that this makes it even worse, try:

    posterizeTime(12);
    valueAtTime(time+1/24);

    hopefully that helps.

    BTW, it’s interesting to check what the Warp Stabilizer would make of the shot..

  • Filip Vandueren

    August 13, 2020 at 8:38 am in reply to: From PSD to AE, Flickering Image Sequence

    I believe it’s the disconnect between one moving in 12FPS and the other, being keyframed, moving smoothly in 24FPS that causes the strobing
    Does it look better when you set you entire composition to 12 fps in the comp. settings ?

  • Hi Walter,

    I remixed yours to get a 2D-3D hybrid:
    apply the coordinates of a true 3D layer to the corner pin to get correct perspective. The best of both worlds.

    14266_subtleorientationhybrid.aep.zip

  • Filip Vandueren

    August 12, 2020 at 11:00 pm in reply to: Can I nest if/else statements?

    You can’t first do an else, and then an else if, that’s probably the error, a missing } before the else if.

    if you’re running in the new javacscript engine, it would expect the outcome of the expression to be on the last executed line.
    So this would be safer:


    output = 0;
    if (v == 0) {
    if (r < 45) {
    output = 100;
    }
    } else if (v == 1) {
    output = 100;
    }
    output; // explicitly finish with the desired outcome

    Also needs a lot less “else” clauses, because the default 0 is already initialized

  • Equivalent to my previous expression, set this expression for position.


    val=valueAtTime(0);
    fd=thisComp.frameDuration;
    for(t=0; time >= t; t+=fd) {
    val = val + toWorldVec(velocityAtTime(t)*fd, t);
    }
    val;

    It can’t work for separated X-Y-Z dimensions though, because reasons. 🙂

  • Filip Vandueren

    August 12, 2020 at 1:15 pm in reply to: From PSD to AE, Flickering Image Sequence

    Hi Melisa,

    The strobing comes from your character being animated on a lower framerate than the background which is being interpolated smoothly.

    So your character stays in the same pose for 2 frames, while the Background interpolates on every frame.

    You can lower the framerate of the entire composition to match the framerate of the character. But then the camera move won’t look as nice.
    It’s a common, classic trade-off in traditonal animation.

  • I understand that it’s a different way to think:
    – you are positioning in a world coördinate system,
    and what for the layer might look like simply 1000px in Z
    could – depending on the layer’s rotation – actually be 1000px in X… or 500 in Z, and 866.025403784 in Y…

    I don’t think I understand what you would want an expression to solve?
    Do you want to keyframe Z-position as if it’s in local space ?
    For me personally that doesn’t click… for example, what would happen if you:

    – start at 0,0,0
    – push the layer forward 1000px in Z,
    – then rotate 180° along Y,
    – then push again “forward” 1000px in Z…

    Do you want it to be back where it started from, but with a position keyframe of 0,0,2000 ?

    Sure, I could write an expression that handles that… but does that make sense ?

  • In this case I think the only “correct” approach is to keyframe the rotation of your layer,
    and keyframe a slider that determines the speed at which it is travelling through Z-space.
    Like so:


    sp=effect("speed")("Slider");
    val=valueAtTime(0);
    for(t=0; time >= t; t+=thisComp.frameDuration) {
    val = val + thisLayer.toWorldVec([0,0,sp.valueAtTime(t)], t);
    }
    val

    This will add the distance of the slider to the layer’s local Z-axis at every frame, and respect any 3D rotation of the layer even if it’s animated.

  • Could you get away with animating the Z-part of the anchorPoint ?
    Or will there be lot’s of Y-steering adjustments during the animation ? That would be slow to calculate using expressions.

Page 83 of 277

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