0
$\begingroup$

Basically, I have a phrase and want to add a letter every time a marker is met.

i.e. every time a letter is hit while writing a message.

Is It possible to do something like this using the animation nodes?

I found out that the path for them is bpy.context.scene.timeline_markers but don't know how to mix the things together.. ^^"

$\endgroup$

1 Answer 1

2
$\begingroup$

First, we should get the frames at which the markers are set, to do this, we can use this list comprehension:

[marker.frame for marker in bpy.context.scene.timeline_markers]

Which returns the frames at which the markers were set:

Expression

Next, I am going to subtract the current frame from this list, now all the markers that have frame values less than the current frame will have negative values. If I max the output with zero, all the values that were negative will become zero. If I "not" (Invert) the result, all zeros becomes ones and non zeros becomes zeros. If I sum all the values of the output, I will get the number of markers that are before or at the current frame. I can now use this output in a Trim Text Node to show the characters:

Node Tree

Which results in:

Result

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .