Xpresso: Cycle through lines of text in list, csv, or similar


I’m creating several templates for lyric videos, and it occurs to me that the entire process could be much more user friendly (and much easier to re-use in the future) if there were a way to keep the lyrics separate from the code or the objects… like a list, csv, or similar.

Most basic behavior is just for it to swap out the text in an motext, spline shader, or other item every time an event happens, frame threshold is crossed, index number increases or whatever. I can work out that bit of it, but does anyone know the best way to access a list such that xpresso can be told to cycle through the lines? I don’t know any python, and tight schedule, so hoping it’s doable with basic xpresso tools… like maybe creating a text field within user data and dumping in the entire text with line breaks, then referencing that field.

If not, open to any suggestions that would streamline a similar process.


A Python node can be used to access lines from a .txt file. The User Data parameter and node input use Filename as the Data Type.


OK, thx.

Working on another template at the moment that doesn’t use the per line approach, but bookmarked so I can revisit.



Asked some troubleshooting q’s, but I think I’ve got it worked out now. Main issue was that I missed use of square brackets vs parentheses in line 9. Remedied by looking up some console errors, and seeing common causes for them.

May well have follow up q at some point, but basic concept appears to be working. Thx.


How’s the big picture w/your project k?


Cutting all the bits I haven’t been able to work out yet. Still working on:

  1. Character animation (already rigged)
  2. Head animation so I can run it through Escher slicer
  3. A few remaining text animations (most are done)

Most of the rest of the bits are ready to start rendering out or nearly so. The trick in this thread was pretty useful. I’ve got a few templates worked out where it provides perfectly timed text animations based on a master txt file. I may share some of them once it’s out. Some combine text with various optical illusions or perspective tricks.

I’ve got some bits from AE and live footage ready to comp too, but still need to wrap a few other items like YT channel explainer vid. .

Overall, I’m shooting for release by the beginning of next month.

I need a vacation. Unfortunately, the real work starts once it’s released.


Forgot to add:

I’m just doing it manually (which works fine) with a manual input for the number of lines in the txt file, but out of curiosity… anyone got an automatic way to return the number of lines in the txt file if the file includes some blank lines between stanzas? (Count the blank lines, but end count at last non-blank line).


Sounds good. Keep us posted.