Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions spring rotation script for rod roll text animation

  • spring rotation script for rod roll text animation

    Posted by Manojit Ghose on September 14, 2010 at 9:21 am

    hi i am trying to create a rod roll text animation.

    i intend to incorporate a spring/bounce effect on every rotation before it comes to a halt, however it seems to be a bit too tedious to do it manually.
    does anyone have a clue if this could be achievable through a script?

    i would appreciate any help.

    thanks m

    MG

    Chris Wright replied 15 years, 8 months ago 3 Members · 6 Replies
  • 6 Replies
  • Chris Wright

    September 14, 2010 at 4:27 pm

    sounds like a job for my handy dandy inertial bounce expression.

    https://forums.creativecow.net/thread/227/14268

    https://technicolorsoftware.hostzi.com/

  • Brian Yarnell

    September 14, 2010 at 6:28 pm

    Those expressions rock! Does anyone have a helpful expression, or other quick way, to get the text to only be visible when it is facing a camera?
    Thanks

  • Chris Wright

    September 14, 2010 at 7:07 pm

    well a layer invisible when facing away from the camera could be a vector. just paste in opacity of text set as 3D.

    if (toCompVec([0, 0, 1])[2] > 0 ) value else 0

    or fade gradually -courtesy of Dan’s handiwork!

    fadeAngle = 35;
    v = toCompVec([0,0,1]);
    d = length(toWorld(anchorPoint),thisComp.layer(“Camera 1”).toWorld([0,0,0]));
    c = v[2]/d;
    ease(c,Math.cos(degreesToRadians(fadeAngle)),1.0,0,100)


    also I got this working which I find incredibly useful.

    name your rectangle “End 2” and paste this in rotation of the arrow with an added slider

    Now you can use a dummy system so that you can parent objects, and the code will always auto orient to the layer being called to.

    follow2 = “End 2”
    diff = sub(position,this_comp.layer(follow2).position);

    (Math.atan2(diff[1],diff[0]) * 180/Math.PI) + 180+effect(“Slider Control”)(“Slider”)

    https://technicolorsoftware.hostzi.com/

  • Manojit Ghose

    September 15, 2010 at 9:06 am

    hi chris!

    you are dead right on what i wanted! thanks a ton. 🙂
    one more question! in AE 3d space any object is seen on the both sides (like a 2 sided material in 3d apps) is there a way to make it visible only on one side (like a object is visible only the side it has normals facing in a 3d app.).

    MG

  • Chris Wright

    September 15, 2010 at 9:59 am

    a simple test to lookAt the orientation data from the layer

    an expression which orients a layer towards a camera can be used backwards to get data to create an if statement for opacity. Simply see what data it gives and put that in the if statement.

    NOT tested…

    orientation expression

    L = thisComp.layer(“Camera 1”);
    lookAt(fromWorld(L.toWorld(L.transform.anchorPoint)),transform.anchorPoint)

    https://technicolorsoftware.hostzi.com/

  • Chris Wright

    September 15, 2010 at 9:34 pm

    Apply this expression to the opacity, it’ll disappear whenever it’s flipped away from the camera

    a = toWorldVec([0,0,1]);
    b = thisComp.activeCamera.position – toWorld(anchorPoint);
    c = dot(a,b)/length(b);
    if (c > 0) 0 else value

    Apply this expression to your ‘Scale’ attribute and it’ll automatically ‘flip’ the layer in 3d space when the camera goes behind it. This way, your text will never be seen from behind, for instance.

    [(toCompVec([0, 0, 1])[2] > 0 ? 1 : -1) * scale[0], scale[1], scale[2]]

    https://technicolorsoftware.hostzi.com/

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