I’m trying to accomplish something and i’ve been scouring the internet now for over 2 hours and I’ve been trying stuff from this forum and another forum for over 2 hours and I’m completely new to expressions. so I wanted to find out if A) what I’m trying to accomplish is even possible and I believe it is, and B) how to do it (or find out what I’m doing wrong…)
I have a sequence. I have a precomp in this sequence. the precomp has a flat outlined logo. the precomp is 3d (not that that matters). I’ve duplicated the precomp 40 times within this sequence. and I’ve offset each precomp by 1 frame (i.e. PreComp on Layer 1 comes in at 0:00:00:00, Precomp on Layer 2 comes in at 0:00:00:01, Precomp on Layer 3 comes in at 0:00:00:02, and so on for 40 layers). NOW HERE IS WHAT I’M TRYING TO DO with all 40 of these layers:
layer 1’s position: 960, 540, 0
layer 2’s position 960, 540, -1
layer 3’s position: 960, 540, -2
etc… for all 40 layers…. change the z position by -1.
I’m basically trying to offset each layer’s z position by -1. (Which is super easy to do the manual way, yet somewhat time consuming if you have a ton of layers). So I thought I could write an expression to expedite this? (That’s what I’m trying to do: write an expression that would be applied to one layer in order to offset the Z position of all 40 layers by 1 increment without having to manually type it into every single layer, to make it look like this logo is growing/extruding when you view it from the side). This is possible right?
The 6 second point of this video is what I’m basically doing. having the walls ‘grow’. and I have the project file and the person who authored this is manually decreasing the Z position by 1. They arent using an expression. but I wanted to get clever and write an expression to speed up that process of manually typing it in per layer if/when I create this from scratch.
https://videohive.net/item/architect-logo-reveal-3-versions/9919777
Again, I’m completely new to expressions. Do I add the expression to layer 1 and parent all subsequent layers to layer 1? Or do I add this expression to a null on top and parent all layers to the top null?
I tried reading this forum and tried to understand the code and tried to apply to mine but I’m not sure that it’s working:
https://forums.creativecow.net/thread/227/25272
I went to layer 1, and typed in the following expression VERBATIM for position. Is this correct? I’m looking at my comp and it kind of looks like it worked but I wanted to know if someone could break down this expression for me and tell me if I’ve wrote this out correctly, if I’m supposed to substitute numbers in place of the word “value”?:
offset = -1;
p = thisComp.layer(“Layer1”);
t = time + offset * index;
z = p.position.valueAtTime(t)[2];
[value[0],value[1],z]
Any help would be appreciated! Thanks!
offset = -1;
p = thisComp.layer("Layer1");
t = time + offset * index;
z = p.position.valueAtTime(t)[2];
[value[0],value[1],z]