
This makes sure that 0

We’re looking for one or more integers, which in regex is + at the end of the line, which in regex is $. We use the JS string method match()to find a numerical suffix in the name, using regular expressions. name returns the name of the layer, which is a string. So I use the numerical suffix of the layer’s name to define its position along the curve (I’ve updated it to work with any number of layers). Strings can become numbers if you treat them as numbers, without any to-do. I take advantage of javascript’s sloppiness with typing. You could also use the layer’s index, but the method I used has the advantage that you don’t need to keep the layers in order, and you can have more than one layer at the same point. This is a value from 0 to 1, There are lots of other ways you could do this, in this case I use the layer’s name to drive it. Here we’re getting each handle’s anchor point in world terms. P1=thisComp.layer("H1").toWorld(thisComp.layer("H1").transform.anchorPoint) p2=thisComp.layer("H2").toWorld(thisComp.layer("H2").transform.anchorPoint) Ī layer’s toWorld() method returns the position of a given point on that layer with respect to the the world.
#AUTOHOTKEY STRINGSCAN PC#
P 0 and P 3 e easy they’re the position of these points Let me share with you five of the most useful AutoHotKey scripts for everyday PC use. Now to turn that into a useable expression. P 0 P 1, P 2 and P 3 are all vectors, aka two- or three-dimensional arrays or matrices. Using capture2text along with AHK is a great way to grab text you normally cant highlight and put it into the clipboardDownload.

They don’t have to be the same, in this example they all have different scale, and they’re based on two different coloured solids.ĭon’t worry, you can skip this bit if you’re allergic to maths.Ī Beziér curve is defined by this equation:ī( t) = (1 – t) 3P 0 + 3(1 – t) 2 tP 1 + 3(1 – t) t 2P 2 + t 3P 3 , They’re above the controls in the timeline-this too is important for the way I’ve implemented the expression. I named them-and this is important-as c1, c2 c3 etc. In this case it is a bunch of solids with circular masks. These are the layers that are going to be animated. It also allows me to rotate the end points to twist the spline, meaning I can mostly just move and rotate my end points to control the whole thing. To make editing easier I parented the handles to the end points-if you’re used to Beziér controls in most design apps this is the way they normally work, with the point having handles that are attached to it. In the example above the beginning is yellow, the handles are ‘sea foam’ and green and the end is blue. They’re all nulls, but you could use anything. There are four controls: the beginning and end points, and two handles to define the curve. So to prevent me having to reinvent it another time, here’s how it’s done… First I made my controls I’ve done this a couple of times, and each time I’ve had to consult Wikipedia for the formula and then turn that into useable expressions. It creates an easy to use rig, that allows you to easily create fluid motion with minimal controls. This is great for flexible spines, caterpillars, snakes, or in the example I’m working on: swimming fish. Com/roelvandepaarWith thanks & praise to God, an.It’s great to be able to animate a stack of layers using familiar Beziér handles.
