Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions auto scale problem

  • Dan Ebberts

    March 22, 2024 at 5:30 pm

    I think the problem might be that the gap gets scaled because of your parenting chain. I think I’d try to set it up without the explicit parenting (just handle positioning and scaling with expressions).

  • Adam Greenberg

    March 22, 2024 at 8:57 pm

    I have tried to redo it multiple times and I cant find a way to make it work. I am sure the problem lies with the sourcerectattime on the precomp, because once the text scales down with longer text, the original calculation doesnt work to place that precomp after the text

  • Adam Greenberg

    March 26, 2024 at 4:04 pm

    finally found the error

    I had a + in my initial code that I forgot about.

    I cant even remember the original reason I had that in there, but for this purpose, it is not needed. here is the fixed project for anyone who would need this kind of rig

  • Elizebth jolley

    April 2, 2024 at 2:32 pm

    It sounds like you’re trying to ensure that the precomp containing the logo maintains its position relative to the text layer as the text scales down. To achieve this, you can use the following expression on the position property of the precomp layer:

    javascript

    textLayer = thisComp.layer("Text Layer Name"); // Replace "Text Layer Name" with the actual name of your text layer offset = 50; // Adjust this value to set the distance between the text and the precomp // Calculate the new position of the precomp based on the text layer's position and scale x = textLayer.transform.position[0] + textLayer.sourceRectAtTime().width / 2 + offset; y = textLayer.transform.position[1]; [x, y]

    This expression calculates the x-position of the precomp based on the text layer’s position and width. The offset variable controls the distance between the text and the precomp. Adjust this value as needed for your layout. The y-position remains unchanged to keep the precomp vertically aligned with the text layer.

    Apply this expression to the position property of your precomp layer, and it should maintain its relative position to the text layer as the text scales down.

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