Forum Replies Created

Page 984 of 1081
  • Dan Ebberts

    March 5, 2007 at 4:03 am in reply to: Expression language to say “any layer”

    Not directly. You can loop through all the layers though, which might give you what you’re after. What are you trying to do?

    Dan

  • Dan Ebberts

    February 28, 2007 at 6:20 pm in reply to: merry-go-round with four objects

    You might have to do it this way if your objects are parented to the merry-go-round:

    lookAt(thisComp.activeCamera.position,toWorld(anchorPoint));

    Dan

  • Dan Ebberts

    February 25, 2007 at 7:56 pm in reply to: Position connected to the rotation

    This should do it:

    if (rotation < 0){ linear(rotation,-80,0,[5,7],[0,0]); }else{ linear(rotation,0,140,[0,0],[6,0]); } Dan

  • Dan Ebberts

    February 23, 2007 at 6:00 pm in reply to: 3d Shadow layer with no color?

    Recipe for shadow-catching invisible layer:

    Use a white solid.
    Set mode to Multiply.
    Accepts Shadows = on.
    Accepts Lights = off.

    Dan

  • Dan Ebberts

    February 23, 2007 at 2:25 pm in reply to: Another Countdown Question

    Something like this maybe:

    clockStart = 120; // start time in seconds
    clockTime = clockStart – time;
    sec = Math.floor(clockTime).toString();
    ms = Math.floor((clockTime%1)*100).toString();
    if (ms.length < 2) ms = "0" + ms; sec + ":" + ms Dan

  • Dan Ebberts

    February 21, 2007 at 3:41 am in reply to: how to orient-to-camera using only 1 axis

    OK – but it’s a little hard to describe without a diagram.

    delta = toWorld(anchorPoint) – thisComp.activeCamera.toWorld([0,0,0]);

    This line just calculates the vector (distance and direction) from the camera to the layer. It looks complicated because it’s using the toWorld() layer space transform to convert the layer and camera positions to world coordinates. This is only necessary if the layer or the camera is the child of another layer, but it makes the expression more general to assume that’s the case. If you don’t have to worry about parenting, you could use something like this instead:

    delta = position – thisComp.activeCamera.positon;

    The next line:

    radiansToDegrees(Math.atan2(delta[0],delta[2]))

    This is pure trig. Looking from the top, the vector calculated in the first line defines the y rotation that you need to get the layer to turn towards the camera. That y rotation can be calculated from the arc tangent of the x and z components of the vector (that’s what atan2() does). JavaScript represents angles in radians, but AE’s rotation property expects degrees, so we use radiansToDegrees() to do the conversion.

    Hope that helps – it’s a lot to bite off if you aren’t comfortable with a little vector math and trig.

    Dan

  • Dan Ebberts

    February 21, 2007 at 2:09 am in reply to: how to orient-to-camera using only 1 axis

    Try this on your y rotation property:

    delta = toWorld(anchorPoint) – thisComp.activeCamera.toWorld([0,0,0]);
    radiansToDegrees(Math.atan2(delta[0],delta[2]))

    Dan

  • Dan Ebberts

    February 15, 2007 at 2:30 pm in reply to: Change layer order with expressions

    Yeah, I’d make them all 3D and use an expression like this to sort them in Z space:

    below = 0;
    for (i = 1; i <= thisComp.numLayers; i++){ if (i == index) continue; if (thisComp.layer(i).position[1] < value[1]) below--; } [value[0],value[1],below] Dan

  • Dan Ebberts

    February 15, 2007 at 2:05 pm in reply to: Question for Dan (or anyone else) about noise()

    Strangely, noise() returns a value in the range -1 to +1.

    dan

  • Dan Ebberts

    February 13, 2007 at 6:48 pm in reply to: axis/expression problem

    Possible, but not simple. I think you’d have to write some code that would start at the current comp time and loop backwards through the comp until you found the time when layer1 arrived a y = -102, then calculate where layer2 should be now based on how long it’s been, how fast you want the move to occur, and the distance to be traveled.

    Dan

Page 984 of 1081

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