How do I pair a layers "Y Rotation" to a Control Layer?

Scripting for After Effects

How do I pair a layers "Y Rotation" to a Control Layer?

Postby varxtis on 08/2/2017, 11:15 pm

Im trying to do a tile flip reveal animation where it starts as just a white screen, but then hundreds of hexagons flip/rotate over to reveal an image. Im trying to control a Null Objects "Y Rotation" using a control layer. The control layer is a precomp of a basic linear wipe. The original tutorial I followed explains it's use with regard to the Null Objects scale, and it works great. But I need it to effect the Y Rotation instead of the scale. Here is the expression I used:
Code: Select all
sourceLayer = thisComp.layer("Hex Control Layer");

sampleSize = [1,1];

samplePoint = transform.position;

colour = sourceLayer.sampleImage (sampleSize.samplePoint);

x=colour[0]*100

[x,x]

Its the last line, the [x,x] that seems to be the issue, but I cant figure out what it's supposed to be.
Can someone fill me in?
varxtis
 
Posts: 140
Joined: 01/3/2010, 9:28 pm

Re: How do I pair a layers "Y Rotation" to a Control Layer?

Postby JPT7505 on 08/3/2017, 8:27 am

Can't you just pick whip it (y rotation) to the control layer?
JPT7505
 
Posts: 724
Joined: 02/9/2011, 8:17 am

Re: How do I pair a layers "Y Rotation" to a Control Layer?

Postby varxtis on 08/3/2017, 9:21 am

I can, but unless Im missing something (which could be very likely), all that does is tell the null object that the control layer is suppose to make the null object do something. It doesn't tell null object what or how. I don't this identifying the source layer is my issue. Its something thereafter thats the issue. But again, I could very well be wrong. And be be on the safe side, I did make sure to try your suggestion a few times in a few different ways.
varxtis
 
Posts: 140
Joined: 01/3/2010, 9:28 pm

Re: How do I pair a layers "Y Rotation" to a Control Layer?

Postby JPT7505 on 08/3/2017, 5:42 pm

Exactly, that's what the control layer is for, for control. So that layer has to have keyframes or an expression that feeds whatever is attached to it.
JPT7505
 
Posts: 724
Joined: 02/9/2011, 8:17 am

Re: How do I pair a layers "Y Rotation" to a Control Layer?

Postby varxtis on 08/3/2017, 7:25 pm

I hear ya...
yes, the source layer itself is animated, with a black to white linear wipe. Keep in mind, as I said, I already did this to the scale property and it worked just like I needed. But I decided to change how the tiles animate in, Rotate instead of grow. Heres the tutorial I followed
https://www.youtube.com/watch?v=4OQN2mHQuD0
varxtis
 
Posts: 140
Joined: 01/3/2010, 9:28 pm


Return to After Effects Expressions