Realistic Strings in After Effects
- To use string expressions in Adobe After Effects, you must use specific language that the software understands. For example, read the following string: thisComp.layer("Effect Controls").effect("Time Decay")("Slider"). "ThisComp.layer" refers to the current composition, and the ".layer" refers the variable layer that will be affected. The layer is then listed in the parentheses. The effect that the string controls is the "Time Decay," and it is controlled using a "Slider" effect.
- Use strings to set the position on the screen. You can click and place the layer into a position and then edit the expression, or manually set the expression yourself. The default position expression is "x = ##; y = ## [x,y]. Replace the number symbols with the actual positions. The "x" represents the horizontal position, while the "y" represents the vertical position. Click on the "3D layer" icon to add the "z" position attributes that push the objects forwards and backwards.
- When you use motion on an object, adding the "Decay" string will make the object slowly stop. The realistic movement slowly moves the speed without jittery or jumpy movements. Open the "Position" attribute of your layer and press "E" for expressions. Underneath all the motion data, press "Enter" and type "decay = ##;." Replace the number symbols with a value between 0 and 10 to add decay to the project. If the video is long, you can increase the decay to a higher number. Render a preview to see the decay and whether any adjustments are needed.
- Use math strings in the expressions to create realsitic and increasing movements. The two main math functions are the "Math.sin" and "Math.cos" strings. "Math.sin" creates an equal wave movement, while the "Math.cos" string creates an increasing wave movement. To add this string, add it to the "y" function of your expression. Use a math phrase like "amp*Math.sin(freq*time*2*Math.PI)" to create the waves. Increase the height and time of each wave by adding "- rise*time + .8*thisComp.height;." That string will rise the animation to the top and bottom of the comp without going off the composition.
String Format
Position
Decay
Math Functions
Source...