The Default Object this_layer
Object references can quickly become very wordy, and hard to read. After Effects tries to simplify the most common references by offering a default object: this_layer. If you dont specify any other global object, After Effects will assume you meant to use this_layer, and will proceed from there. This is why you can write simply opacity without having to write this_layer.opacity.
If the idea of a default object seems strange to you, think about the the address analogy we used earlier. When sending a letter inside the US, you could omit the country and the postal service would make delivery with no problem. Theyd simply assume that you meant to specify the US. The US in this example is a kind of default object. Whenever you dont specify some other country that is, some other global object the system will assume you meant to specify the US and carry on from there. Similarly, if you don't specify a global object in After Effects, it will assume that you meant to use its default object, this_layer.
Of course, if you want to refer to anything outside the current layer, youll need to start by specifying the appropriate global object.
Even when you just want to select another layer in the same comp, you cant just write layer("Layer 1") because layers are not global objectsthey belong to comps, and After Effects needs to know which comp youre talking about. So youll need to start with the global object this_comp:
Remember this construction youll use it more than you might expect.
Entire contents © 2001 JJ Gifford.