-
Typing Keyboard Expression Challenge.
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!