Forum Replies Created

Page 976 of 1081
  • Using switch is a cool way to do it. You could combine that with code to get the index of the most recent marker, then you could set it up so that you just need to drop a layer marker wherever you wanted the next expression to start.

    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n–;
    }
    }

    switch (n) {
    case 1:
    // expression 1
    break;
    case 2:
    // expression 2
    break;
    case 3:
    // expression 3
    break;
    default:
    // default expression (no markers or more than 3)
    }

    Dan

  • Ah, that triggered a memory. I’ve had expressions generate inappropriate errors when I’ve got the graph editor up, because the graph editor displays values before and after the comp. So if you opened the graph editor with an expression refering to the active camera, I’d guess it might generate an error since it likely doesn’t exist before the first frame.

    Dan

  • >does AE freak out if a comp has that many layers?

    I set up a similar thing (lots of layers following a leader on a 3D path) for a tutorial I did for the Meyers’ CMG Vol. 2, without any issues like you’re seeing.

    If you’re doing something silly like having each layer reference the previous one, you might trigger and expression engine timeout, which will indeed disable some expressions, but you should get an error message.

    Other than that it’s hard to say without seeing your code. All I can say is that I’ve never seen the symptoms you describe.

    Dan

  • Interesting solution, Filip. I like it.

    Because of the nature of these types of simulations, it does grind to a halt pretty quickly, but I don’t think there’s anything that can be done about that.

    I did find a typo in this line:

    return thisComp.layer(index-1)position.valueAtTime(t-0.1);

    (missing period before “position”).

    Good job!

    Dan

  • Which version of AE? What do the expressions look like?

    Dan

  • Hmmm… I think this could end up being a fairly complicated simulation if you want each layer to be affected by its own momentum and the acceleration of the layers on either side while staying on the path defined by the leader.

    I’m sure there’s a way to do it, but I don’t have a canned solution for you.

    Dan

  • It just specifies the time that the wiggle value is retrieved from. Works kind of like valueAtTime().

    For fun, apply this expression to a small solid’s position and then duplicate the solid a bunch of times:

    delay = 0.1;
    seedRandom(1,true);
    wiggle(1,200,1,0.5, time – (index-1)*delay)

    Dan

  • Dan Ebberts

    May 1, 2007 at 5:22 pm in reply to: Help tweaking an expression

    Math.round() rounds to the nearest integer value, which could be up or down, while Math.floor() always rounds down.

    Dan

  • Dan Ebberts

    May 1, 2007 at 3:18 pm in reply to: Help tweaking an expression

    Try changing the second line to this:

    seconds = Math.floor( time % 60 );

    Dan

  • Dan Ebberts

    April 29, 2007 at 7:29 pm in reply to: Can this be done with expressions/scripting?!

    toFixed(n) just rounds a number off to n decimal places.

    Dan

Page 976 of 1081

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