Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Multiple comps using same code

  • Multiple comps using same code

    Posted by Brian Mills on July 9, 2015 at 2:39 pm

    I have a precomp with graphic(Set of brackets that highlight text) that are being reused though out a comp. I want to be able to re position the brackets horizontally via a slider to fit around different sized sentences.

    I have this on the position of the graphic bracket in the precomp

    temp = comp(“Main”).layer(Bracket).effect(“SliderControl”)(“Slider”);
    [temp,value[1]]

    And a slider control on the precomp(Brackets) in the Main comp.

    How can I get it to work when I duplicate the precomp(Brackets). It only works with the top most copy on the timeline. Ive been trying to ref the index(layer#) for the precomp Bracket…but I cant seem to figure out how to do it
    Thanks for any help

    Dan Ebberts replied 10 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    July 9, 2015 at 4:52 pm

    So you want the expression in the precomp to refer to the slider that’s on that precomp’s layer in the main comp, is that correct?

    That’s not going to work if you’re duplicating the precomp layer in the timeline.

    If you’re duplicating the precomp in the project panel, you just need to make sure each precomp has a unique name. Then you can do it this way:

    temp = comp(“Main”).layer(thisComp.name).effect(“SliderControl”)(“Slider”);
    [temp,value[1]]

    Dan

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