0
$\begingroup$

Hello wonderful people!

A problem solving mind needed here... I have expired the use of mine...

AIM:

To create a text animation sequence (for character dialogue) with a style that types into place letter by letter and then opacity fades, then repeats several times with different text objects - using animation nodes.

PROPOSED METHOD:

To have several text objects in a list, which will cycle through in an animation sequence as follows: Text object one will appear letter by letter as if being typed into place, then it will hold for a second and fade out. Then text object one will move out of place and in its place text object two will be placed, then it will animate in the same way - type into designated area, then hold for a second then fade, then for the remaining text objects.

THE STORY SO FAR...

I created 3 text objects, put them in a list and have a repeated time of 70 frames, during which the text is trimmed to give typing effect. I created some math and logic to give us a signal when the repeat cycle is complete, so that when 70 frames is up, a 1 is given which could then trigger the next text object in the list, but I am not sure how to change the index of the text object list to the next in the sequence...

Please see the screenshot of the nodes setup and the blender 2.8 .blend file is also attached.

nodetree

blend file:

SOLUTION (Omar Ahmad):

Create a new loop with an iterator of type ‘integer list’ named integer. Add two parameters of type ‘integer’ named sum and padding. In loop node’s N menu, in Advanced Node settings, Add a generator of type ‘integer list’. In the loop node’s N menu add a ‘reassign parameter’ node for the sum parameter socket. Create a text list with text objects populated… Create expression node with numpy statement. In the expression Nodes N menu, under Advanced Node settings, insert the module numpy, by comma separating to add it to the current module, so that it reads math,numpy. Add an input of type ‘integer list’ named sums and an input of type ‘integer’ named frame. Add a get list element which receives the text list, and has an index as the result of the expression node, which makes its calculation based on the frame in ‘time info’ and the integer list of the invoke subprogram node for the recursive sum loop.

current frame minus the numpy expression. math result in to trim text end, to give the amout of text trimming. then the text selected list goes in to the text input of the trim node.

The integer list of the recursive sum loop is received from the text length node, which outputs a list of integers, which are the character lengths of each text item in the text list.

The sum integer gives a delay before the text animates. The padding integer gives a delay between each item list animation.

$\endgroup$
  • $\begingroup$ Please add the .blend by uploading it to blend-exchange.giantcowfilms.com and edit it into your question, so we don't have to rebuild your setup $\endgroup$ – WhatAMesh Feb 26 at 9:58
  • $\begingroup$ ah, thank you kindly, here's the link to the blend file: <img src="https://blend-exchange.giantcowfilms.com/embedImage.png?bid=5941" /> $\endgroup$ – Li Brinto Feb 26 at 10:16
  • $\begingroup$ @LiBrinto Welcome to stackexchange! Not entirely sure what you are trying to achieve. Can you split the question into two parts: (1) What do you want to achieve in details, perhaps and illustration or an example. (2) What did you try so far. $\endgroup$ – Omar Emara Feb 26 at 11:42
  • $\begingroup$ Hi Omar, thanks. My ultimate aim is to have several text objects which will cycle through in an animation sequence as follows. Text object one will appear letter by letter as if being typed into place, then it will hold for a second and fade out . Then text object one will move out of place and in its place text object two will be placed, then it will animate in the same way - type into designated area, then hold for a second then fade, then for the remaining text objects. $\endgroup$ – Li Brinto Feb 26 at 13:30
  • $\begingroup$ @LiBrinto Everything thing alright? Did you manage to replicate this? $\endgroup$ – Omar Emara Feb 27 at 7:51
2
$\begingroup$

I am assuming you want to maintain a uniform typing speed across texts. In which case, we can assign a weight to each text based some other factor. This weight act as a duration multiplier to maintain a uniform typing animation. In this case, I will choose the length of the text as the weight. Next, I will compute a list that represents the starting times of each animation based on the weights we just computed. This can be done using a simple loop as follows:

Node Tree

The padding is just a constant added to pad the duration allowing for holding the animation for some time. Next, we want to know, at any time, which text are we typing. To do that we use the following numpy expression:

numpy.argmax(sums.asNumpyArray() > frame) - 1

It basically gets the index of the first element in the sums list that is larger than the current frame.

Node Tree

Make sure to import numpy in the Advanced Node Settings of the Expression node. Next, we get the text and its starting time at the output index, we subtract the its starting time from the time and use that as the end trim value as follows:

Node Tree

Now, lets divide the time to slow it down a bit and see what the result:

Result

Increasing the padding will increase the interval between the starting animation of each text. The fading effect can be created just as we did, so I will let you do that on your own.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.