this project would not have been possible without steve miller’s mesh tension add-on. i studied it extensively to figure out how to work with the depsgraph and blender UI.
mesh tension is a great script for making shaders react to mesh squeeze and stretch (i.e., tension maps). it has its own thread at Revised mesh tension add-on
i use it often in my own works, it’s a great time saver since the tension maps feature was removed along with blender internal in ages past.