Tutorial 23: Manipulating Text from CSV Spreadsheets in Cavalry

In this tutorial, you will learn how to use text data from CSV spreadsheet inside Cavalry. We will create an animation from this data, combine 2 columns to create 1 text string. Then, I will show you how to dynamically change text font weight, size, colour and position offset. All this, without a single keyframe.

Special thanks go to Chris Hardcastle, Cavalry co-founder and Remco, founder of Scenery for helping me with the solution to a problem in this set up.

Math Modulus

The main set that I’m using is getting values from CSV Spreadsheet to populate the Text with. This Text layer goes into Duplicator. All is perfect, if you are only making no more copies, than there are rows in your CSV spreadsheet – for example, 48 in the tutorial.

If you are going to create more copies, than you have data, for example 100 copies in Duplicator. Then Cavalry will return empty values. To fix this, I had to use Math Modulo formula. Here is another explanation on Stack Overflow.

By using Duplicator > Index Contex with Spreadsheet > Row Count, we are essentially “wrapping up around” the data. Once we reach the end of the CSV data, we are forcing Cavalry to start adding it from the beginning. This is happening all because of Modulo formula.

This is really helpful, as we can create lots of copies of our data and not worry about empty fields.

Get Vector with Falloff

Another key piece of the set up is the Get Vector modifier. In essence, this vector simply pushes away other object from an object or point we specify. This way, everything gets pushed correctly, and equally. By combining it with a Falloff, we can easily target specific text in our duplicator.

To keep things easy to update and organised, I ended up using only single Falloff. This kept the project light and easy to update, and by simple parenting and linking properties, such as Duplicator > Radius, we can keep it procedural.

Get Project File From Gumroad

This project file contains all the assets necessary to make animation in the tutorial in final form. Everything is labeled, linked, with expressions and ready to use, if you wish to make your own version or just play around with it.

If you have any suggestions for tutorials or how I can improve, please do get in touch. I would love to hear from you.

Found it helpful? Consider sharing it with others.

Other tutorials

2024-12-23T17:48:06+00:00December 23rd, 2024|Tutorials|
Go to Top