Forum Replies Created

Page 961 of 1081
  • Dan Ebberts

    September 20, 2007 at 3:02 pm in reply to: Combining two expressions

    Not sure about your setup, but play around with this:

    rMax = 150;
    decay = .3;
    freq = 6;
    aStart = 0;
    aRate = 270;
    offsetFactor = 10;

    r = rMax/Math.exp(time*decay);
    a = degreesToRadians(aStart + aRate*time);
    offset = (r/offsetFactor)*Math.sin(freq*time*Math.PI*2);
    center = [thisComp.width/2, thisComp.height/2];
    center + [Math.cos(a),Math.sin(a)]*(r + offset);

    Dan

  • Dan Ebberts

    September 19, 2007 at 1:29 am in reply to: Using Variables from another Layer

    The best way would probably be to put together a script that would read a text file and replace all the text in the text layers.

    If you don’t want to do that, you could do it with expressions. As an example, say you have a master comp with a master text layer with a comma-delimited expression for source text that looks like this:

    “text 1,text 2,text 3”

    In another comp, you could have a text layer with an expression that extracts the the third string (“text 3”) of the master text – like this:

    txt = comp(“master comp”).layer(“master text”).text.sourceText;
    txt.split(“,”)[2]

    So the trick would be to put your text together in one string, separated by commas and then set up your other layers to extract the piece it needs using split().

    Dan

  • Dan Ebberts

    September 18, 2007 at 9:17 pm in reply to: Using Variables from another Layer

    An more detailed example of what you’re trying to do would be helpful.

    Dan

  • Dan Ebberts

    September 17, 2007 at 7:18 pm in reply to: Using Variables from another Layer

    You can’t access the variables in another expression, just the result. You could put a bunch of text in one text layer though and have expressions in the other text layers search for their piece of the text (assuming you identify it somehow in the master text).

    There’s prabably a way to accomplish what you’re trying to do.

    Dan

  • This should do the trick:

    C = thisComp.activeCamera;
    v1 = toWorldVec([0,0,-1]);
    v2 = normalize(C.toWorld([0,0,0]) – toWorld(anchorPoint));
    angle = radiansToDegrees(Math.acos(dot(v1,v2)));
    linear(angle,0,45,100,0)

    Dan

  • Dan Ebberts

    September 13, 2007 at 8:52 pm in reply to: Does a simple keyframable elastic/spring solution exist?

    This modified version seems to work for rotation. It’s actually a little simpler than the position version because you don’t have to deal with vectors.

    restAngle = 0;
    damp = .95;
    leader = thisComp.layer(“leader”);

    fDur = thisComp.frameDuration;
    currFrame = Math.round(time / fDur);

    r2 = transform.rotation.valueAtTime(0);
    v2 = 0;
    for (f = 0; f <= currFrame; f++){ t = f*fDur; r1 = leader.transform.rotation.valueAtTime(t); delta = r2 - r1; a = 2 *(delta - restAngle) * fDur; v2 = (v2 - a) * damp; r2 += v2; } r2 Dan

  • Dan Ebberts

    September 13, 2007 at 8:27 pm in reply to: 3d strokes between two 3d layers

    There’s always a way. 🙂

    Are you talking about straight lines connecting 3D layers? Do they have to respect the 3D stacking order? For example, for a line connecting a layer close to the camera with one far away, you would expect the line to be obscured as it goes behind the closer object but you would see the attach point on the most distant object. With text I guess it’s even more complex – do you need to see the line between the letters of the forground text layer?

    Depending on what you’re after, I may have a very nice solution for you, but I think it may be a little too complex to post in the forum but we’ll figure something out.

    Dan

  • Dan Ebberts

    September 13, 2007 at 8:00 pm in reply to: Converting 3D position to 2D ?

    You would normally use anchorPoint (which is always expressed in layer space), but cameras and lights don’t have anchorPoints so you just use [0,0,0]. You’re correct that if you use [0,0,0] with a regular layer, you’ll get the upper left corner.

    Dan

  • Dan Ebberts

    September 13, 2007 at 5:20 pm in reply to: Does a simple keyframable elastic/spring solution exist?

    Not that I know of, but that’s a great idea. You should be able to modify the position expression to work for rotation. I’ll give it some thought.

    Dan

  • Dan Ebberts

    September 13, 2007 at 4:58 pm in reply to: Does a simple keyframable elastic/spring solution exist?

    If Motion Math would work, this expression solution might be helpful:

    https://www.motionscript.com/design-guide/elastic.html

    Dan

Page 961 of 1081

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