Responsive

/*  There needs to be two layers named 'startCard' & 'endCard'
    This allows rotation value to dynamically change when layers are inserted or removed.
    All duplicates need to be placed within these two layers
*/

//anchor point
radius = 500
value+[0,0,radius]

// Y rotation

startIndex=thisComp.layer("startCard").index; 
endIndex = thisComp.layer("endCard").index;
numpt = startIndex-endIndex+1; // total number of layers
myIndex = index-startIndex;
angle = 360/numpt

myIndex*angle

Linking layers' rotation with opacity

Challenge: creating user-friendly controls

  • Writing expressions can be easy for you but it's a complete foreign language to other people. If you pass an expression setup to your team mates, there are chances they do not know how to operate it, modify or troubleshoot or their own.

  • The best practice is to create everything they need in the Effects panel without them having to change any expressions.

  • Subsequently, more functionalities can be added as the user realize the limitations of your setup.

Importance of converting to world space

  • sourceRectAtTime only reads the source size and any scale change is not applied. Hence to get the correct pixel size of a layer, this is the general formula

sourceRectAtTime().widthtransform.scale[0]/100sourceRectAtTime().width*transform.scale[0]/100

Responsive sizing text box

  • Uses: Lower thirds, quotation boxes

Method

  1. Get sourceRectAtTime of source text layer

  2. Create Slider Controls for X & Y padding

Attaching layers to corners of a quote box

Quotation marks attached to the corners of the text box

Method 1: Arithmetic

  1. Get the size of the text layer using sourceRectAtTime

  2. Link the position of the layer to the text position

  3. Subtract or add half the size of the quotation box to get the top or bottom corner

Method 2: Converting sourceRectAtTime to World Space

Implementation

Retrieving all sourceRectAtTime values using animation preset

Personally, I like to retrieve all property values and coordinates and do any necessary calculations into slider controls in a single shape layer or null control. This way, I can just link other parameters to that one layer. The example above, I have saved all slider controls into an animation preset so I can reuse my setup without having to rewrite the expressions

2-liner with conditional sizing (left-aligned text)

Shape follows typewriter

  • Attach a shape layer to the end of a type writer Text Animator on Text layer

  • Or basically, the shape always follows at the end if the written text for it to look like that shape is typing the text on screen?

The challenge is that: sourceRectAtTime do not recognize the size change with Text Animator that is effecting the typewriting.

The solution is to

  • get the position of the text in world space

  • the sourceRectAtTime width

  • adding a padding

linear(completion,0,100,startPos,startPos+sourceRectAtTime.widthlinear(completion,0,100, startPos,startPos+sourceRectAtTime.width

Last updated

Was this helpful?