Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Automated way to redirect a stack of expressions in a comp to pull from a different source layer outside of the comp…

  • Automated way to redirect a stack of expressions in a comp to pull from a different source layer outside of the comp…

    Posted by Jim Lefevre on August 13, 2018 at 5:06 pm

    I am setting up an admittedly complicated project which is centred around a jigsaw.

    I have three rows so far A1-A5, B1-B5 and C1-C5. Each jigsaw piece is a composition with a solid feeding off a luma matte pre-comp (A1_MATTE, A2_MATTE etc…) inside which turns the jigsaw ‘teeth’ on/off.

    These luma mattes feed respectively off the piece to the left and above it which drives their ‘North’ and ‘West’ teeth.

    Currently with any new piece I am having to go all the way through to the respective luma matte, open up the expression and change the expression to point the respective neighbouring layers. I would like to find a simpler way so that I can point all the scripts in the comp towards the new two feeder layers by changing one or two pieces of information at a higher level (perhaps on a top adjustment layer which I generally use as the ‘DRIVER’ layer in a comp).

    For example if I have a new piece ‘D4’ I can change the feeder comps to ‘D3’ and ‘C4’ and that filters through the expressions.

    I thought that maybe the expression control ‘Layer Control’ might be it but it seems to only show me layers within the composition that it is in and I need it to reach the over-arching one.

    To show you my expressions – in piece B3 the B3_LUMA_MATTE has this on its ‘WEST” tooth scale to flip the luma matte…

    a = 100;
    b = -100;
    n = comp("JIGSAW").layer("B2").effect("EAST_on")("Checkbox");

    if (n==0) [a,a] else [a, b]

    …and this on its ‘NORTH’ tooth scale…

    a = 100;
    b = -100;
    n = comp("JIGSAW").layer("A3").effect("SOUTH_on")("Checkbox");

    if (n==0) [a,a] else [a, b]

    Is there any way to change the “comp(“JIGSAW”).layer(“A3″)” section of the expression at a higher level so that it points to another specific layer?

    Does that make sense!?

    Many thanks in advance!

    Jim

    http://www.jimlefevre.com

    Jim Lefevre replied 7 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 14, 2018 at 12:22 am

    I don’t know if this helps, but you could put your layer names (and other parameter names) in centralized text layers, like this:

    layerName = comp(“Main”).layer(“TEXT”).text.sourceText.value;
    n = comp(“JIGSAW”).layer(layerName).effect(“EAST_on”)(“Checkbox”);

    Dan

  • Jim Lefevre

    August 15, 2018 at 5:52 am

    Dan, as ever, thank you.

    That was exactly what I was looking for and I didn’t realise you could feed text layers into expressions like that. That is really exciting as I use a lot of convoluted mechanical processes in After Effects that this makes life a lot easier!

    Thank you again,

    Jim

    http://www.jimlefevre.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy