How may I get a single stripe of color to flow along an object? I'm toying around and trying to get a single red stripe to flow along the length of a cylinder. I'm trying to copy ideas from this tutorial, but I can't quite get it right. I made a gradient with three colors (white, red, and white) and I've got the bands of color being produced alright, but they're a bit skewed and don't line up perfectly with the geometry.
My aim is to incorporate this into some sort of abstract looping animation.
Think of an LED strip, and having just a single LED light up and go down the chain. I want to achieve that similar look using a cylindrical object, and a stripe of color. If I could get it to work with a bent cylinder (like one along a curve) that would be great too.
Any ideas?
Here's what I've got so far:
We can use the &quot;generated&quot; coordinates (from &quot;texture coordinates&quot; node) property: the coordinates are given before any modifier deformations. Using it can simplify what we have to do here.

Or with several rings:

The base shape is a tube/cylinder with a simple deform modifier to make to U shape:

And the node setting is the following:


Take Z value of the generated coordinates (remember this is still considered as a non bent cylinder)
Substract it to some value that will be animated to move the ring(s)
Keep positive value
Multiply (integer values) to have the amount of rings
Take module 1 to keep something between 0 and 1
Compare the result to 0.5 with an epsilon that gives the width of the ring


The documentation about generated texture coordinates:

Automatically-generated texture coordinates from the vertex positions
of the mesh without deformation, keeping them sticking to
the surface under animation. Range from 0.0 to 1.0 over the bounding
box of the undeformed mesh. See Texture Spaces for more information.