Layer control expression

Scripting for After Effects

Layer control expression

Postby David Wood on 02/10/2010, 9:13 am

Hi guys! Does anyone know of an expression that when a Layer control selects a layer, it will take the layer and make it appear on another? So say I have layer 1 with a layer control applied and I want to make layer 2 appear on it, all I have to do is select the layer with the layer control. Thanks! :)
David Wood
 
Posts: 1031
Joined: 01/23/2009, 2:50 pm
Location: Western New York, USA
Twitter: www.twitter.com/djwfx

Re: Layer control expression

Postby Mylenium on 02/10/2010, 9:32 am

What does that have to do with expressions? For that you need an effect that can "remote" other layers' channels such as the Blend and Set Channels Effects...

Mylenium
[Pour Mylène, ange sur terre]
----------------------------------------
www.myleniumblog.com
Mylenium
 
Posts: 3263
Joined: 02/1/2009, 11:45 am
Location: Germany
System Specs: Have, I do!

Re: Layer control expression

Postby David Wood on 02/10/2010, 9:43 am

I forgot about those, but it doesn't help. Neither of those take into account the scaling, position, and rotation.
David Wood
 
Posts: 1031
Joined: 01/23/2009, 2:50 pm
Location: Western New York, USA
Twitter: www.twitter.com/djwfx

Re: Layer control expression

Postby David Wood on 02/10/2010, 3:41 pm

Anybody?
David Wood
 
Posts: 1031
Joined: 01/23/2009, 2:50 pm
Location: Western New York, USA
Twitter: www.twitter.com/djwfx

Re: Layer control expression

Postby JorritSchulte on 02/11/2010, 3:46 am

if you want to do that, you'll have to get in to Pixel bender... (CS4 only)
becouse you can't expression Layer controlls in effects like Set Channel, or any effects.
JorritSchulte
 
Posts: 324
Joined: 08/6/2008, 9:08 am
Twitter: JorritSchulte

Re: Layer control expression

Postby Mylenium on 02/11/2010, 4:35 am

It's really not clear what you want. I think you have a flaw in your thinking here. Scaling, rotation etc. affect the comp buffer, not the layer itself in terms of the pixel sampling. Therefore there can be no such thing as an effect that is able to pipe that info (with the exception being, that the effect would recalculate it all by itself). If you really need such functionality, transforms must be done on the effects level using the effect of same name. Other than that there is no surefire way of getting this. Of course you can always pre-comp.

Mylenium
[Pour Mylène, ange sur terre]
----------------------------------------
www.myleniumblog.com
Mylenium
 
Posts: 3263
Joined: 02/1/2009, 11:45 am
Location: Germany
System Specs: Have, I do!

Re: Layer control expression

Postby David Wood on 02/11/2010, 10:35 am

Oh, ok thanks, that's too bad. :|

A different question, say I have a point control and I want to link a layer's position to it. Instead of having to add the expression to the layer's position (since I have several layers I want connected to different points), can I add an expression to the point control that will basically say ' parent [layer control]'s position to the point control' ?
David Wood
 
Posts: 1031
Joined: 01/23/2009, 2:50 pm
Location: Western New York, USA
Twitter: www.twitter.com/djwfx

Re: Layer control expression

Postby JorritSchulte on 02/11/2010, 11:40 am

Nope, that's impossible, Expressions can only affect the value that ther'e applied to
JorritSchulte
 
Posts: 324
Joined: 08/6/2008, 9:08 am
Twitter: JorritSchulte

Re: Layer control expression

Postby David Wood on 02/11/2010, 12:14 pm

Oh man, I thought you were the guy with all the answers. >-|| ;)
David Wood
 
Posts: 1031
Joined: 01/23/2009, 2:50 pm
Location: Western New York, USA
Twitter: www.twitter.com/djwfx

Re: Layer control expression

Postby Mylenium on 02/11/2010, 1:06 pm

David Wood wrote:can I add an expression to the point control that will basically say ' parent [layer control]'s position to the point control' ?


Again, a logic problem. Expressions work downstream, not upstream. you can make look one item for the values of another, but not force one items values upon another. It's a subtle, but important difference. It shouldn't really be a problem, though, for setting up multiple spatial relations - simply create a dummy layer that holds your crosshair and let the other layers use that data.

Mylenium
[Pour Mylène, ange sur terre]
----------------------------------------
www.myleniumblog.com
Mylenium
 
Posts: 3263
Joined: 02/1/2009, 11:45 am
Location: Germany
System Specs: Have, I do!

Re: Layer control expression

Postby David Wood on 02/11/2010, 2:07 pm

Thanks again, expressions aren't my strong spot, I got to work with them more. :)
David Wood
 
Posts: 1031
Joined: 01/23/2009, 2:50 pm
Location: Western New York, USA
Twitter: www.twitter.com/djwfx

Re: Layer control expression

Postby Michael_Szalapski on 02/11/2010, 4:05 pm

David Wood wrote:...expressions aren't my strong spot, I got to work with them more. :)


Check out Dan Ebberts' site. It's a good place to learn.
______________
Michael Szalapski
Fast. Cheap. Good.
Pick two.
Michael_Szalapski
 
Posts: 8245
Joined: 02/2/2010, 1:06 pm
Location: Nashville, TN, USA
Twitter: thegreatszalam

Layer control expression

Postby carterniggaz on 02/14/2010, 9:49 am

I have a problem with my expression Layer

example:
seedRandom(thisComp.layer("Control").effect("Random")("Slider")+index);
value+[0,0,wiggle(0,thisComp.layer("Control").effect("Position")("Slider"))[2]-value[2]]

It don't work, i can't activated the expression code
carterniggaz
 
Posts: 2
Joined: 02/14/2010, 9:43 am

Re: Layer control expression

Postby Dazydude on 03/22/2010, 2:09 pm

try this?

Code: Select all
seedRandom(thisComp.layer("Control").effect("Random")("Slider")+index);
m = thisComp.layer("Control").effect("Position")("Point")[1];
value+[0,0,wiggle(0,m)[2]-value[2]]


I'm guessing it's for a 3D layer
No signature
Dazydude
 
Posts: 129
Joined: 04/8/2009, 12:40 am
Twitter: username

Re: Layer control expression

Postby Jaydude on 12/4/2014, 4:50 am

Hi, I think this is what you need:

http://vimeo.com/104381026
Jaydude
 
Posts: 1
Joined: 12/4/2014, 4:49 am

Re: Layer control expression

Postby dconklin on 12/4/2014, 10:43 am

The calculations effect can help you with this. The Second Layer Source Layer control allows you 'project' another layer onto your current layer (make sure to turn the opacity up to 100%).

You may be able to bypass your layer control all together and just use this.

Good luck!
dconklin
 
Posts: 19
Joined: 03/23/2011, 6:24 am


Return to After Effects Expressions