Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Moving controller from a nested to comp to the MAIN comp

  • Moving controller from a nested to comp to the MAIN comp

    Posted by Azmain Anwer on February 9, 2025 at 3:53 pm

    Hi,

    After Effects version 2024 (very simple project file “attached”).

    I used PuppetTools to setup simple controllers on a shape layer’s path points.

    I am trying to bring a controller named “C1Torso_line Path 1 : 3” from a nested comp to the “MAIN” comp, but there seems to be a problem. The layer named “Torso_line” needs to be targeted to the controller “C1Torso_line Path 1 : 3” in the “MAIN” comp. I tried “MAIN.comp” expression but it doesn’t work. 😞 Please help.

    Brie Clayton replied 1 month, 1 week ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    February 9, 2025 at 5:50 pm

    You could modify the Torso_line path expression so that it looks at the layer in the main comp instead of the local one, like this:

    var controlLayers = [thisComp.layer("C1Torso_line Path 1 : 1"),thisComp.layer("C1Torso_line Path 1 : 2"),comp("MAIN").layer("C1Torso_line Path 1 : 3")]; 
    var origPath = thisProperty;
    var origPoints = origPath.points();
    var origInTang = origPath.inTangents();
    var origOutTang = origPath.outTangents();
    var control;
    for (var i = 0; i < controlLayers.length; i++){
    control = controlLayers[i];
    origPoints[i] = fromComp(control.toComp(control.anchorPoint));
    }
    createPath(origPoints,origInTang,origOutTang,origPath.isClosed());

    but I don’t think that’s going to give you what you want. It seems like it would be simpler to just tie the local “C1Torso_line Path 1 : 3” layer to the one in the MAIN comp with a position expression like this:

    comp("MAIN").layer(name).position
  • Azmain Anwer

    February 10, 2025 at 6:14 am

    Hi,

    comp("MAIN").layer(name).position

    It did the trick! That is exactly what I was trying to do. Thank you so much Sir Dan Ebberts! 😄👍

  • Brie Clayton

    February 10, 2025 at 2:22 pm

    Thanks for solving this, Dan!

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