Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › After Effects Scripting/ How to parent two values of the layers placed in different compositions

  • After Effects Scripting/ How to parent two values of the layers placed in different compositions

    Posted by Karen Harutyunyan on September 5, 2016 at 3:44 pm

    Hi there.
    Need help in scripting !!! I want to parent current values (for example “position”) of two layers (for example Null objects) which are placed in two different Comps.
    Thanks in advance!!!

    Karen Harutyunyan replied 10 years ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    September 5, 2016 at 3:54 pm

    Parenting is limited to layers in the same comp, but you could connect whichever properties you want with expressions:

    comp(“other comp”).layer(“other null”).transform.position

    Dan

  • Karen Harutyunyan

    September 5, 2016 at 5:32 pm

    Thanks for your respond.
    Is it possible to integrate expression into script ? As I understand this expression must be written to the layer(in my example Null) property(in my case it is position). But how to integrate it into my script ?

    Thanks in advance.

  • Dan Ebberts

    September 5, 2016 at 5:47 pm

    Like this, I guess:

    myLayer.property(“Position”).expression = ‘comp(“other comp”).layer(“other null”).transform.position’;

    Dan

  • Andrew Orlow

    September 6, 2016 at 2:44 pm

    Really?! It’s possible to define expressions this way?
    Wow, never knew

  • Karen Harutyunyan

    September 7, 2016 at 6:52 am

    Yes that was exactly what I wanted. Thank you Dan very much. Everything works in proper way.

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