Since the Basement is half Motion Graph and half interactive, I've been trying to get my hands dirty on the Mo Graph side by learning some Expressions that could help in After Effects.
1. I read through Adobe's help and API. Its a great place to start, but don't expect much from the API.
2. I read through Marcus Geduld's After Effect Expressions, which was a decent, quick read for beginners... more geared towards non-programmers though. A few of the programming examples made me cringe, but its ok, it was helpful in figuring out the layout and rules of the road.
3. I then went to Dan Ebberts's MotionScript.com and ran through some of his tutorials. There is a lot of overlap between MotionScript and Geduld's book, you are probably better off just checking out the website and skipping the book.
After all of that, here is what I've figured out:
2. You can apply any math/physics to any property. Just think Keith Peter's ActionScript Animation minus the mouse/keyboard interaction.
3. Instead of interacting with the mouse... you can tie properties of compositions/layers/effects to each other. So if a butterfly's wings rotate down, you could make the butterfly's body move upwards to simulate thrust.
4. AE makes tying properties together very easy. There is a tool called a "Pick Whip" that makes it as simple as dragging and dropping properties onto either other.
5. However, you need to be careful when tying properties together since properties can return different number of variables... for example "rotation" may have 1 value while "position" may return [x,y].
6. You can't create new layers on the fly. If you wanted 100 butterflies to flock, you would need to create one, place the code on it and then duplicate the layer 99 times... imagine needing to make a change, yuck.
7. Expressions that are coded on one property can not be accessed from another property, nothing is global or even public. For example: if we make a variable called "id" on layer 1, we could not access layer 1's "id" from layer 2. Expressions on each layer live in their own sandbox.
8. Expressions live and die on each frame and have no memory of the previous frames. Now this one is interesting. You can't declare a "counter" on frame one and hope to increase it on frame 2. When the expression on frame 2 executes, it will throw and error because it will not know what "counter" is, even though it was declared on the SAME layer just one frame beforehand.
9. At first I thought this was a huge limitation... however, there are many built in functions for figuring out time, frame number, etc which allow you to script across a timeline.
10. One cool aspect is that you can access a property's value at a specific time (a time that is not the current time). This is actually kinda cool, you can use a future value of another property to impact your current position... something not possible in Flash since future values are unknown.
11. They also added the ability to give random numbers a "seed" to ensure that you get the same random number when you use the same seed. As long as you know the seed, you will get the same results across multiple frames. A little wonky, but it works. And yes, I used the word wonky... I am surprised you are still reading this far to be honest ;)
AE Expressions are nice for syncing properties and adding physics, but it has far too limited sandbox to make anything beyond a neat effect. The real power of scripting can be found in the Extend Script and the Patch Panel. Those are next on my research list.