Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Self Wrapping Text with Dynamic Link

  • Self Wrapping Text with Dynamic Link

    Posted by James Richardson on May 31, 2016 at 7:32 pm

    Hi There,

    I’ve seen this topic brought up a few times, but I have yet to see a simple solution.

    I am pretty new to the scripting language of expressions, so I don’t understand fully how this will work, but I believe there is a way to pull off what I am imagining…

    My goal here is to create a text layer that auto adjusts its scale/size according to the text input of the surrounding guidelines. I think this could be done using a few expressions but I am not entirely sure how it would be written…

    I am currently using this expression to help achieve my goal:
    ___
    out = [100,100];

    for (i = 1; i <= thisComp.numLayers; i++){
    if (i == index) continue;
    L = thisComp.layer(i);
    if (! (L.active && L.hasVideo)) continue;
    delta = (width + L.width)/2;
    if (length(position, L.position) <= delta){
    out = [65,65];
    break;
    }
    }
    out
    ___

    The problem I am running into currently is trying to figure out a way to continuously shrink the text until it is no longer touching, and then stop at that value.

    Any Ideas as to how this could be written?

    Please let me know if I need to describe this better,
    Thanks

    Kalleheikki Kannisto replied 10 years, 3 months ago 3 Members · 2 Replies
  • 2 Replies
  • Joel Arvidsson

    May 31, 2016 at 10:06 pm

    Check out this video. I think its what you want. https://youtu.be/22U9l-ZEsZw

    joelarvidsson@gmail.com

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Kalleheikki Kannisto

    June 1, 2016 at 2:55 pm

    A picture of what you’re trying to accomplish would certainly help to clarify…

    For instance I don’t understand what you mean by “the text input of the surrounding guidelines.”

    Self-wrapping seems to imply you want the text to automatically wrap onto a new line.

    Simple scaling to fit a text box without reflowing the text would probably be relatively easy — if I understood what your “surrounding guidelines” are. Guides? Other layers? Shape layers? Video Layers? 2D layers? 3D layers? Are the other layers moving around during the clip, i.e. do you need to readjust on every frame?

    Automatically reflowing text onto new lines to avoid other laeyrs through expressions would be extremely inconvenient, if even possible.

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