6

Hate to spoil all your good work, but it's a lot easier to use the built-in length() function: length(pointa, pointb) e.g. length(thisComp.layer(1).position, thisComp.layer(2).position) or length([682, 617], [310, 342]); //raw vector values as an array length(thisComp.layer("foo").anchorPoint, [310, 342]); //a spatial property and an array length([123,...


5

This expression is not supported for Mask Path Property, because it's a User Defined Property, see the note of the error message. Workaround Mask Path animation once Precompose your layer an with the animated mask (one time) by Selecting the Layer > Right Click > Precompose (and move all attributes in the new composition) Enable Time Remapping on your ...


5

Found the answer here. Copying any positional keyframes out of After Effects generates a text file like this: Adobe After Effects 8.0 Keyframe Data Units Per Second 25 Source Width 100 Source Height 100 Source Pixel Aspect Ratio 1 Comp Pixel Aspect Ratio 1 Transform Scale Frame X percent Y percent Z percent ...


4

To drive an animation by another layer use the pick whip or the selection list to parent it. In the following example the Camera (layer) adopts all animation properties of the Null. Note: Camera is a 3d layer in your case, make sure 3d layer toggle is enabled for the Null too.


4

Another option if you don't want to create a pre-comp: Make your mask and set the keyframes and apply this expression to the mask path property: valueAtTime(time % key(numKeys).time) This is basically an implementation of the loopOut function, but it works for all properties, including custom ones like mask shapes. How it works: valueAtTime returns the ...


3

Yes, since expressions are basically JavaScript, you can load and evaluate external source files. Unfortunately the location needs to be hard-coded, since (AFAIK) expressions do not have access to the path of your AE project, so it's rather brittle. For instance: try { myPath = "~/Desktop/source.js"; $.evalFile(myPath); } catch(err) { "MISSING"; ...


3

There are a number of physics engines and related scripts available in the Physics Simulation category at AEScripts. However, without a more specific question about what kind of animation you're looking for (that is to say, I don't know how the electrons in an atom are supposed to move), it's hard to point you to a specific answer.


3

Yes, checkLayers() is what is performs the collision test, and compares every layer in the Comp against the one running the script. To check against only one layer, you could re-write that function a little cleaner, but here's a quick solution. First, remove the lines that start and end the for loop, since you'll only be checking one layer. But don't ...


3

I found out - .value after slider.effect("Slider Control").property("Slider") and it works. var a = slider.effect("Slider Control").property("Slider").value


3

I figured it out. The syntax and/or order of operation could not handle squaring two numbers before adding them, so I added parenthesis to isolate each number and square them BEFORE adding them together. function findDistance(xa, xb, ya, yb) { return Math.sqrt( ((xa - xb)^2) + ((ya - yb)^2) ); } findDistance(682, 617, 310, 342);


3

Darby Edelen posted an answer on Creative Cow. You won't be able to define any spatial paths any other way, but this should work: d = 5; fd = d * 2; p1 = [200, 500]; p2 = [500, 200]; t = (time - inPoint) % fd; if(t <= d) linear(t, 0, d, p1, p2); else linear(t, d, fd, p2, p1); This starts from p1 at the beginning of the layer and runs to p2 ...


3

There's no property called xPosition, and transform is a property of a layer, not a method, but you're on the right track. The expression has to return an array of two values [x, y], and the components of the position are stored in an array like that too. The expression you want — if you're applying it to the layer position property — is this: xpos=thisComp....


3

Easy fix, you see the small sun icon on the imported comp layer? Disable that, that basically means that the comp should act like the layers within it should act like they are in the parent comp. It negates the transformation your are applying to it and the effect will just keep its pixel value its supposed to have, you are not "blowing it up" like you would ...


3

So, I figured it out by myself. The problem was the anchorpoint. My images were on even pixels but the anchorpoint was odd. So the solution is to use following expressions: // Position newX = Math.round(transform.position[0]); newY = Math.round(transform.position[1]); [newX, newY] // Anchorpoint newX = Math.round(transform.anchorpoint[0]); newY = Math....


3

I actually found the answer in the CS3 scripting guide. CompItem#selectedLayers actually returns an array of AVLayer objects. AVLayer is a subclass of Layer and has quite a few attributes. Here are a few of them: Masks Effects Anchor points Position Scale X Rotation Y Rotation Opacity Oddly enough, when calling these attributes you need to pay attention ...


3

If you want to link certain properties through several composition you can only do this with expressions. They are really not difficult though and its a matter of 1-2 lines. F.e. to get the position of a layer in a different composition you can do this: comp("Comp Name").layer("Layer Name").transform.position Just alt click the position stop watch of the ...


3

The random number generator in AE seems to be linked to the layer index, but generates the same results for every composition. To demonstrate here's a comp with a shape layer where the vertices of the shape are generated by the wiggle() function: Here's the expression: var newPath = []; for (var i=0; i<=160; i++){ x = i*thisComp.width/160; y = ...


2

Looks like Adobe have come to the party on this one. A new update as of After Effects CC 2014.2 (13.2) has a sourceRectAtTime() method that does exactly what I'm wanting. To quote their blurb: You can now read the rectangle bounds of a layer’s content, including the corrected bounds of a text layer, for any time in a composition. The sourceRectAtTime()...


2

So you want the width of the whole text object no single characters? In that case you could use this: http://motionboutique.com/text-bounds-expresssion-580/ A tutorial plus sample project on how to get the bounding box of a text layer. In case the link dies, here is the complete expression they use to determine the bounding box. step = 1.0; // higher ...


2

Assuming the same thing happens in each window... Make the action that will be inside the first window in its own comp. Then duplicate the comp 19 times, and use something like the brilliant pt_shiftlayers script to stagger each of the layers half second after the previous one.


2

Use a camera with a long focal length. The longer the focal length, the closer to isometric. Just back the camera far enough away to frame the shot.


2

It's trickier than it seems if you want to do the whole thing from scratch. //first make some shortcuts //choose the property to drive it - could be any property on any layer myproperty=transform.position //choose the keys that define the movement - in AE key indexes start at 1, not 0 key1=myproperty.key(1); key2=myproperty.key(2); //more shortcuts pos1=...


2

I'm not sure what the valueAtTime function is trying to achieve. That takes the value of the property at the given time. In the script you wrote it would sample the value of the opacity at a point a random number of seconds in the past, some time between the current time and maxOffset seconds ago. Unless the opacity changes during that time it won't do ...


2

You can loop over the range of frames from the start of the comp to the present and calculate the value along the way. function myFuncf(theTime){ //whatever the function you're using to create the value, e.g. t=theTime + s.valueAtTime(theTime); //s is the slider return t } firstFrame = timeToFrames(inPoint); //if you want it to calculate ...


2

I do not know of any existing solutions for this in Premiere or AE. However, if you know a little about programming, you might be able to write a script using OpenCV that runs Tesseract OCR on video frames, and comes out with the text you want. Once you have the text and time codes, you definitely could write a script to build the titles at the appropriate ...


2

You can't put the expression on a null object, but you can use a text layer. Following @bobtiki's eval() tip I tried using the source text of a text layer and running eval() on it. Initially I had no success, I was getting an "object of type TextProperty found where a Number, Array or Property is needed" error. But if I put something like a number on its ...


2

The easiest way to do this is to use an expression. First you convert audio to keyframes. Then set an expression on your opacity channel. If you drag the pick-whip for the expression to the audio keyframe property you'll get an opacity that bounces all over the place like crazy, so we're going to have to do a bit more to it. First, in the opacity channel ...


2

You were close. if (numKeys > 1){ t1 = key(1).time; t2 = key(2).time; v1 = [95, 95]; //or if it's 3d [95, 95, 95] slider = comp("INPUT").layer("CONTROL").effect("Zoom intensity")("Slider"); v2 = [slider, slider]; // or [slider,slider,slider] if 3D linear((time, t1, t2, v1, v2); } else { value } You were right that the scale property ...


2

The size in pixels is easily computed as the source's original dimensions multiplied by the scale. Or in other words p = d × s where p=pixel dimensions required, d=source dimensions, s=scale. So to set the scale so that it takes a given source and makes it conform to a desired dimensions: s = p / d In an expression on the scale property you'd use var ...


2

The setup is reasonably simple, built in functions, trigonometry and some Pythagoras will get you there. Have a look at the diagram below: The orange solid is the crank, with its anchor point shown at the bottom. Its rotation drives the whole thing (you could drive it from the piston, but this is probably easier(?)). In your diagram the crank isn't shown, ...


Only top voted, non community-wiki answers of a minimum length are eligible