Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position text only inside area

  • Position text only inside area

    Posted by Niclas Hallgren on March 20, 2020 at 9:43 am

    Hi!

    I’ve to generate a comp that will show 160+ names (four names at a time) at random positions. The output will be a 3840×2160 file but as it a video wall (4 screens) there are areas that will not be visible. I’m generating a comp from scratch (run script file) and everything is working perfectly but as it is now I must manually move the layers to fit inside the visible area.

    Have someone done this and can give me some advice before I’ll try to re-invent the wheel ????

    Andrei Popa replied 6 years, 5 months ago 2 Members · 3 Replies
  • 3 Replies
  • Andrei Popa

    March 22, 2020 at 9:04 am

    Har way, but looks better:
    You can save data for the layer(width, top, bot, left, right). First, check if the layer has one of the 4 corners out. Then check if its smaller than a screen(as width). If it is, move it horizontally to fit inside the screen. If it’s larger, move it vertically until it reaches the point where it can be displayed on 2 screens.

    Easy way:
    Put the text only in the space with all the screens(red area).

    Andrei
    My Envato portfolio.

  • Niclas Hallgren

    March 22, 2020 at 10:01 am

    Thanks for the input Andrei. I had the same thought but the client wants more spread to the names so I can’t limit it to a box in the middle. I remade my shape layer so it is now one instead to four and I found Dan Ebberts collision guide that might be the solution to the problem.

  • Andrei Popa

    March 26, 2020 at 8:40 am

    Here is how i would do this. Draw the rectangles from the first picture again. Then also draw the red one I made. After placing the text, add a function that does this:

    (is the layer inside red square?)
    yes =>DONE
    no=> (is the layer’s width smaller than one rectangle?)
    yes => check which rectangle is closer and place it entirely there by changing x position
    no=> reposition layer and rerun this function.

    To check which rectangle is closer, first check y position and see if its bottom or top. Then I think you can easily check which one is by considering the position and the justification of the text.

    Also, the project will run much faster if you do this with script at the creation point and not with a lot of expressions.

    Andrei
    My Envato portfolio.

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