Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Typing Keyboard Expression Challenge.

  • Typing Keyboard Expression Challenge.

    Posted by Joshua Stearns on January 1, 2013 at 4:29 pm

    I may be jumping into the deep end of things a little faster than one should, but I’m working on a project with a coworker and having a bit of trouble finding the bits and pieces I need to make this code work. We’re trying to design a dynamic animation for a keyboard typing in a keyword. This gets used in the office enough that it would save us time to have AE do the heavy lifting. let me explain what we’re looking for in the end product.

    It would start with a word/words entered by the artist using the template, say ‘keyword’. This would be a text field already set to animate with a typewriter effect.

    The expression would break that string down, and for each character it would animate a key on a keyboard over x amount of time, roughly matching the keyword typing onto the screen. This animation would either be a pre-rendered clip (which seems quite a bit harder, if not impossible) or the position of a still image.

    Ideally, the length of the keyboard animation would match the length of the typewriter animation, and possibly be adjustable either by moving the type keyframes or having both rely on an expression slider.

    I don’t have the programming expertise to put this into code, but I know enough that I think I know HOW it should work. This isn’t so much code as it is a pseudo-code description of what I think I need. Just hoping it’ll jumpstart someone with a little more knowledge.

    keywordArray = sourceText; //The string the artist enters.

    lengthOfString = The number of values in the array. Not sure how to get this number.;

    animationTime = Total length over which the whole animation should happen. Adjusted either by keyframes or slider(s).;

    animationStart = Start time for the whole animation.;

    keypressTime = animationTime/lengthOfString;

    (Assuming this is done with still images/animated position)
    for each value in keywordArray:
    characterCount = location in array.;
    keypressStart = animationStart+(keypressTime*characterCount);
    keypressMiddle = keypressStart+(keypressTime/2);
    keypressEnd = keypressStart+keypressTime;

    Y position at current value for corresponding key at keypressStart.
    Y position +10px (or however many) at keypressMiddle.
    Y position back to starting position at keypressEnd.

    (If using time-remapped clips)

    for each value in keywordArray:
    characterCount = location in array.;
    keypressStart = animationStart+(keypressTime*characterCount);
    keypressEnd = keypressStart+keypressTime;

    select corresponding clip,
    time remap start at keypressStart;
    time remap end at keypressEnd;

    Hopefully I’ve managed to express what I’m trying to do, and someone can help me sort this out. I don’t necessarily need nor want it written for me, but some guidance in how to access certain values and the proper way to turn this all into code would help. I’ll keep on exploring AE and Javascript tutorials as well. Thanks in advance for any help you can give me!

    Stefan Hinze replied 13 years, 4 months ago 3 Members · 4 Replies
  • 4 Replies
  • Stefan Hinze

    January 2, 2013 at 12:26 am

    Hi,

    im not shue if this is what you need..
    (i´m no native english speaker.. and i am not shure if i understood correctly)

    https://ae.tutsplus.com/tutorials/motion-graphics/quick-tip-type-on-text-preset-with-blinking-cursor/

    You can turn the cursor off.
    I hope this helps
    😉

  • Bryan Woods

    January 2, 2013 at 1:55 am

    Thats a really useful expression from that tutorial. Watch your speakers and ears though if you watch it. The guy has his mic up REALLY loud. I blew out my little earphones when I first started it. Pissed me off a good deal too.

  • Joshua Stearns

    January 4, 2013 at 8:34 pm

    Thanks Stefan,

    This tutorial isn’t the bit I was looking for, but it’s still a useful effect, and I may incorporate it into this project. The part I’m looking for still is the keyboard itself, rather than what would be on screen. A dynamic animation of the keys being pressed as the text types on.

  • Stefan Hinze

    January 4, 2013 at 9:01 pm

    Ah, ok!
    No sorry, on that i can´t help!
    Good luck!

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