Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions parent/child linking without scale.

  • parent/child linking without scale.

    Posted by Richie Tovell on December 1, 2009 at 3:09 am

    I’ve got one layer parented to another but I want the child layer to only accept the position and rotation values of the parent layer not it’s scale, I need the scale values in the child layer to remain at 100,100,100.

    Is this easy to do, Anyone?

    Regards

    Richie

    Coda – musical selections; in film, the ending or last section of a film (often wordless).

    Joao Monteiro replied 10 years, 6 months ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    December 1, 2009 at 3:33 am

    Try this Scale expression for the child:

    s = [];
    ps = parent.transform.scale.value;
    for (i = 0; i < ps.length; i++){ s[i] = value[i]*100/ps[i]; } s Dan

  • Richie Tovell

    December 1, 2009 at 4:15 am

    Hi Dan, thanks for the help.

    No luck this end I’m afraid, the layer still scales smaller and larger, I wonder if it might have something to do with how many children are stacked above it, I don’t know. .

    I found an expression of yours for the same thing only excludes rotation, but I couldn’t adapt it to work for scale.

    value – parent.transform.rotation

    maybe this will offer a clue?

    Coda – musical selections; in film, the ending or last section of a film (often wordless).

  • Dan Ebberts

    December 1, 2009 at 4:27 am

    >I wonder if it might have something to do with how many children are stacked above it

    Yup – that solution will definitely not work if the parent has a parent. Try this one:

    L = thisLayer;
    s = transform.scale.value;
    while (L.hasParent){
    L = L.parent;
    for (i = 0; i < s.length; i++) s[i] *= 100/L.transform.scale.value[i] } s Dan

  • Richie Tovell

    December 1, 2009 at 4:33 pm

    Success!!!

    Thank you Dan, I should be able to keep this shot within the comp bounds now whilst it’s deforming, it’s a lot of juggling around with some of the layers being delayed to scale at different times, but I think it’s going to look insane, I also got past my 3D warps problem so in addition to the collapsing of the layers, they can also be warped in to additional 3d shapes, crazy 🙂

    Thanks Dan, I envy your talents 😉

    Coda – musical selections; in film, the ending or last section of a film (often wordless).

  • Joao Monteiro

    November 12, 2015 at 4:24 pm

    Hi Victor,

    4 years later in case you still figuring it out.

    I believe you were getting that error as you were trying to parent a 3D layer to a 2D layer.
    That’s why you were getting the error.

    Hope it still helps.
    Cheers
    JoaoMonteiro

    https://www.joaomonteiro.tv

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