Speed (Vector) Render Pass Code to achieve New Effect

Hello All,

After much Python coding and fiddling with Blender’s Speed (Vector) render pass, I can’t get the result I want. Instead of the delta x and y from the previous and next frames, I would like each frame to tell me how far each pixel is from the FIRST frame.

I’m trying to have a 2D texture ‘stick’ on a moving object.

So, does anyone know where the code is located? I’ve looked but I don’t have a clue. Also, any tips or workarounds would be greatly appreciated.

THANKS!!!